# set terminal png transparent nocrop enhanced font arial 8 size 420,320 # set output 'electron.3.png' set dummy jw,y set grid nopolar set grid xtics nomxtics noytics nomytics noztics nomztics \ nox2tics nomx2tics y2tics nomy2tics nocbtics nomcbtics set grid layerdefault linetype 0 linewidth 1.000, linetype 0 linewidth 1.000 set logscale x 10 set logscale y 10 set logscale x2 10 set offsets 0, 1, 0, 0 set samples 160, 160 set xtics border out scale 1,0.5 mirror norotate offset character 0, 0, 0 autofreq set ytics border out scale 1,0.5 nomirror norotate offset character 0, 0, 0 autofreq set ztics border out scale 1,0.5 nomirror norotate offset character 0, 0, 0 autofreq set y2tics border out scale 1,0.5 nomirror norotate offset character 0, 0, 0 autofreq set cbtics border out scale 1,0.5 mirror norotate offset character 0, 0, 0 autofreq set title "Amplitude and Phase Frequency Response" set xlabel "jw (radians)" set xrange [ 1.10000 : 90000.0 ] noreverse nowriteback set x2range [ 1.10000 : 90000.0 ] noreverse nowriteback set ylabel "magnitude of A(jw)" set y2label "Phase of A(jw) (degrees)" set yrange [ * : * ] noreverse nowriteback # (currently [0.00000:5.00000] ) Ie(Vbe)=Ies*exp(Vbe/kT_q) Ic(Vbe)=alpha*Ie(Vbe)+Ico Ida(Vd)=Ido*(1-Vg/Vp)**2 Idb(Vd)=Ido*(2*Vd*(Vg-Vp)-Vd*Vd)/(Vp*Vp) Id(Vd)= (Vd>Vg-Vp) ? Ida(Vd) : Idb(Vd) A(jw) = ({0,1}*jw/({0,1}*jw+p1)) * (1/(1+{0,1}*jw/p2)) Ies = 4e-14 kT_q = 0.025 alpha = 0.99 Ico = 1e-09 Ido = 2.5 Vg = 0.3125 Vp = -1.25 p1 = 10 p2 = 10000 plot abs(A(jw)), 180/pi*arg(A(jw)) axes x2y2