Advertisement
luizaspan

Gráfico corrente por tensão diodo

May 21st, 2015
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.41 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. #define is 1.0e-8
  5. #define q 1.6e-19
  6. #define n 2
  7. #define kb 1.38e-23
  8. #define T 350
  9.  
  10. // com v variando entre -1.5V e 3.4V
  11.  
  12. int main(void)
  13. {
  14. double i,v;
  15.  
  16. i=1.0;
  17.  
  18. for (v=-1.5;v<=3.4;v+=0.1)
  19. {
  20. i=is*exp(q*v/(n*kb*T));
  21. printf("%e\t %lf \n",i,v);
  22. }
  23.  
  24. return 0;
  25. }
  26.  
  27. // plot "q.dat" u 2:1 w lp t "T=272K","q2.dat" u 2:1 w lp t "T=300K","q3.dat" u 2:1 w lp t "T=350K"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement