from math import *
from pylab import *
#Calculation
dip=(14.0-10.7)*10**(-3) #A
dvp=20 #V
rp=dvp/dip
diP=(12.4-5.3)*10**(-3) #A
dvG=1 #V
gm=diP/dvG
u=gm*rp
ut=(192-150)/1
# Result
print " The Plate AC Resistance is rp= ",round(rp/10**(3),2),"kohm"
print " The Mutual Conductance is gm= ",gm/10**(-3),"mS"
print " The Graphical Amplification Factor is u= ",round(u,2)
print " The Theoretical Amplification Factor is ut= ",ut
#plot
#At Vg=0
V1=[0,50,100,150]
I1=[0,3.5,11.2,20.0]
#at Vg=-1
V2=[60,100,150,200]
I2=[0,4,12.4,21.5]
#at Vg=-2
V3=[100,150,200]
I3=[0,5.4,14.1]
#at Vg=-3
V4=[160,200,250]
I4=[0,3.4,12.4]
#at Vg=-4
V5=[220,250,300]
I5=[0,2.5,11.3]
figure(1)
import numpy
import pylab
fig = plt.figure()
ax = fig.add_subplot(111)
a1=plot(V1,I1)
a2=plot(V2,I2)
a3=plot(V3,I3)
a4=plot(V4,I3)
a5=plot(V5,I4)
xlabel("Vp (V)")
ylabel("Ip(mA)")
ax.annotate('vg=0', xy=(152,21),
arrowprops=dict(facecolor='black', shrink=0.5),
)
ax.annotate('vg=-1', xy=(200,21.5),
arrowprops=dict(facecolor='black', shrink=0.5),
)
ax.annotate('vg=-2', xy=(200,14.1),
arrowprops=dict(facecolor='black', shrink=0.5),
)
ax.annotate('vg=-3', xy=(250,12.4),
arrowprops=dict(facecolor='black', shrink=0.5),
)
ax.annotate('vg=-4',xy=(300,11.3),
arrowprops=dict(facecolor='black', shrink=0.5),
)
show(a1)
show(a2)
show(a3)
show(a4)
show(a5)