📄 electron.dem
字号:
## $Id: electron.dem,v 1.1.1.1.2.1 1999/10/11 13:25:14 lhecking Exp $## Electronics demo## Bipolar Transistor (NPN) Mutual CharacteristicIe(Vbe)=Ies*exp(Vbe/kT_q)Ic(Vbe)=alpha*Ie(Vbe)+Icoalpha = 0.99Ies = 4e-14Ico = 1e-09kT_q = 0.025set dummy Vbeset gridset offsetsset nologset nopolarset samples 160set title "Mutual Characteristic of a Transistor"set xlabel "Vbe (base emmitter voltage)"set xrange [0 : 0.75]set ylabel "Ic (collector current)"set yrange [0 : 0.005]set key boxset key .2,.0045set format y "%.4f"plot Ic(Vbe)set format "%g"pause -1 "Hit return to continue"# Junction Field Effect Transistor (JFET) Mutual Characteristic# drain current above pinch offIda(Vd)=Ido*(1-Vg/Vp)**2# drain current below pinch offIdb(Vd)=Ido*(2*Vd*(Vg-Vp)-Vd*Vd)/(Vp*Vp)# drain currentId(Vd)= (Vd>Vg-Vp) ? Ida(Vd) : Idb(Vd)# drain current at zero gate voltageIdo = 2.5# pinch off voltageVp = -1.25# gate voltageVg = 0set dummy Vdset nogridset nokeyset offsets 0, 1, 0, 0set title "JFET Mutual Characteristic"set xlabel "Drain voltage Vd (V)"set xrange [0 : 4]set ylabel "Drain current Id (mA)"set yrange [0 : 5]set label "-0.5 Vp" at 4.1,0.625set label "-0.25 Vp" at 4.1,1.4set label "0" at 4.1,2.5set label "Vg = 0.5 Vp" at 4.1,3.9plot Vg=0.5*Vp,Id(Vd),Vg=0.25*Vp,Id(Vd),Vg=0,Id(Vd),Vg=-0.25*Vp,Id(Vd)set nolabelpause -1 "Hit return to continue"# show off double axes# amplitude frequency responseA(jw) = ({0,1}*jw/({0,1}*jw+p1)) * (1/(1+{0,1}*jw/p2))p1 = 10p2 = 10000set dummy jwset grid x y2set keyset logscale xyset log x2set nolog y2set title "Amplitude and Phase Frequency Response"set xlabel "jw (radians)"set xrange [1.1 : 90000.0]set x2range [1.1 : 90000.0]set ylabel "magnitude of A(jw)"set y2label "Phase of A(jw) (degrees)"set ytics nomirrorset y2ticsset tics outset autoscale yset autoscale y2plot abs(A(jw)), 180/pi*arg(A(jw)) axes x2y2pause -1 "Hit return to continue"# undo what we've donereset
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -