home *** CD-ROM | disk | FTP | other *** search
/ c't freeware shareware 1999 February / CT_SW9902.ISO / pc / software / wissen / daten / gnuplot.hqx / gnuplot.2.0b4 / Scripts / demo / electron.dem < prev    next >
Text File  |  1997-05-03  |  2KB  |  91 lines

  1. #
  2. # $Id: electron.dem,v 1.4 1996/08/13 21:48:22 drd Exp $
  3. #
  4. # Electronics demo
  5. #
  6. # Bipolar Transistor (NPN) Mutual Characteristic
  7. Ie(Vbe)=Ies*exp(Vbe/kT_q)
  8. Ic(Vbe)=alpha*Ie(Vbe)+Ico
  9. alpha = 0.99
  10. Ies = 4e-14
  11. Ico = 1e-09
  12. kT_q = 0.025
  13. set dummy Vbe
  14. set grid
  15. set offsets
  16. set nolog
  17. set nopolar
  18. set samples 160
  19. set title "Mutual Characteristic of a Transistor"
  20. set xlabel "Vbe (base emmitter voltage)"
  21. set xrange [0 : 0.75]
  22. set ylabel "Ic (collector current)"
  23. set yrange [0 : 0.005]
  24. set key .2,.0045
  25. set format y "%.4f"
  26. plot Ic(Vbe)
  27. set format "%g"
  28.  
  29. pause -1 "Hit return to continue"
  30.  
  31. # Junction Field Effect Transistor (JFET) Mutual Characteristic
  32. # drain current above pinch off
  33. Ida(Vd)=Ido*(1-Vg/Vp)**2
  34. # drain current below pinch off
  35. Idb(Vd)=Ido*(2*Vd*(Vg-Vp)-Vd*Vd)/(Vp*Vp)
  36. # drain current
  37. Id(Vd)= (Vd>Vg-Vp) ? Ida(Vd) : Idb(Vd)
  38. # drain current at zero gate voltage
  39. Ido = 2.5
  40. # pinch off voltage
  41. Vp = -1.25
  42. # gate voltage
  43. Vg = 0
  44. set dummy Vd
  45. set nogrid
  46. set nokey
  47. set offsets 0, 1, 0, 0
  48. set title "JFET Mutual Characteristic"
  49. set xlabel "Drain voltage Vd (V)"
  50. set xrange [0 : 4]
  51. set ylabel "Drain current Id (mA)"
  52. set yrange [0 : 5]
  53. set label "-0.5 Vp" at 4.1,0.625
  54. set label "-0.25 Vp" at 4.1,1.4
  55. set label "0" at 4.1,2.5
  56. set label "Vg = 0.5 Vp" at 4.1,3.9
  57. plot Vg=0.5*Vp,Id(Vd),Vg=0.25*Vp,Id(Vd),Vg=0,Id(Vd),Vg=-0.25*Vp,Id(Vd)
  58. set nolabel
  59.  
  60. pause -1 "Hit return to continue"
  61.  
  62. # show off double axes
  63.  
  64. # amplitude frequency response
  65. A(jw) = ({0,1}*jw/({0,1}*jw+p1)) * (1/(1+{0,1}*jw/p2))
  66. p1 = 10
  67. p2 = 10000
  68. set dummy jw
  69. set grid x y2
  70. set key
  71. set logscale xy
  72. set log x2
  73. set nolog y2
  74. set title "Amplitude and Phase Frequency Response"
  75. set xlabel "jw (radians)"
  76. set xrange [1.1 : 90000.0]
  77. set x2range [1.1 : 90000.0]
  78. set ylabel "magnitude of A(jw)"
  79. set y2label "Phase of A(jw) (degrees)"
  80. set ytics nomirror
  81. set y2tics
  82. set tics out
  83. set autoscale  y
  84. set autoscale y2
  85. plot abs(A(jw)), 180/pi*arg(A(jw)) axes x2y2
  86.  
  87. pause -1 "Hit return to continue"
  88.  
  89. # undo what we've done
  90. reset
  91.