Annotation of OpenXM_contrib/gnuplot/demo/electron.dem, Revision 1.1.1.2
1.1 maekawa 1: #
1.1.1.2 ! maekawa 2: # $Id: electron.dem,v 1.1.1.1.2.1 1999/10/11 13:25:14 lhecking Exp $
1.1 maekawa 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]
1.1.1.2 ! maekawa 24: set key box
1.1 maekawa 25: set key .2,.0045
26: set format y "%.4f"
27: plot Ic(Vbe)
28: set format "%g"
29:
30: pause -1 "Hit return to continue"
31:
32: # Junction Field Effect Transistor (JFET) Mutual Characteristic
33: # drain current above pinch off
34: Ida(Vd)=Ido*(1-Vg/Vp)**2
35: # drain current below pinch off
36: Idb(Vd)=Ido*(2*Vd*(Vg-Vp)-Vd*Vd)/(Vp*Vp)
37: # drain current
38: Id(Vd)= (Vd>Vg-Vp) ? Ida(Vd) : Idb(Vd)
39: # drain current at zero gate voltage
40: Ido = 2.5
41: # pinch off voltage
42: Vp = -1.25
43: # gate voltage
44: Vg = 0
45: set dummy Vd
46: set nogrid
47: set nokey
48: set offsets 0, 1, 0, 0
49: set title "JFET Mutual Characteristic"
50: set xlabel "Drain voltage Vd (V)"
51: set xrange [0 : 4]
52: set ylabel "Drain current Id (mA)"
53: set yrange [0 : 5]
54: set label "-0.5 Vp" at 4.1,0.625
55: set label "-0.25 Vp" at 4.1,1.4
56: set label "0" at 4.1,2.5
57: set label "Vg = 0.5 Vp" at 4.1,3.9
58: plot Vg=0.5*Vp,Id(Vd),Vg=0.25*Vp,Id(Vd),Vg=0,Id(Vd),Vg=-0.25*Vp,Id(Vd)
59: set nolabel
60:
61: pause -1 "Hit return to continue"
62:
63: # show off double axes
64:
65: # amplitude frequency response
66: A(jw) = ({0,1}*jw/({0,1}*jw+p1)) * (1/(1+{0,1}*jw/p2))
67: p1 = 10
68: p2 = 10000
69: set dummy jw
70: set grid x y2
71: set key
72: set logscale xy
73: set log x2
74: set nolog y2
75: set title "Amplitude and Phase Frequency Response"
76: set xlabel "jw (radians)"
77: set xrange [1.1 : 90000.0]
78: set x2range [1.1 : 90000.0]
79: set ylabel "magnitude of A(jw)"
80: set y2label "Phase of A(jw) (degrees)"
81: set ytics nomirror
82: set y2tics
83: set tics out
84: set autoscale y
85: set autoscale y2
86: plot abs(A(jw)), 180/pi*arg(A(jw)) axes x2y2
87:
88: pause -1 "Hit return to continue"
89:
90: # undo what we've done
91: reset
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>