from __future__ import division
Idss=15*10**-3
Vgso=-5
#Id=Idss*(1-(Vgs/Vgso))**2
Vgs=0
Id=Idss*(1-(Vgs/Vgso))**2
print "Id=%0.2f"%(Id*10**3),"mA"
Vgs1=-1
Id=Idss*(1-(Vgs1/Vgso))**2
print "Id=%0.2f"%(Id*10**3),"mA"
Vgs2=-4
Id=Idss*(1-(Vgs2/Vgso))**2
print "Id=%0.2f"%(Id*10**3),"mA"
%matplotlib inline
from matplotlib.pyplot import plot,xlabel,ylabel,show
from numpy import arange
from __future__ import division
Vgs=arange(-5,-21,-5) ##Id=Idss*(1-(Vgs/Vgso))**2
Vgso=-20
Idss=12*10**-3
Id=[]
for x in Vgs:
Id.append(Idss*(1-(x/Vgso))**2)
for x in Id:
print "Id=%0.2f"%(x*10**3),"mA"
y=arange(0,13,1)
x=arange(0,-21,-5)
plot(Vgs,Id)
xlabel("Gate-to-source voltage (VGS)")
ylabel("Drain current ID(mA)")
show()
from __future__ import division
Idss=20*10**-3
vp=-8
gmo=5000*10**-6
vgs=-4
#Id=Idss*(1-(Vgs/Vgso))**2
Id=Idss*(1-(vgs/vp))**2
print "Id=%0.2f"%(Id*10**3),'mA'
gm=gmo*(1-(vgs/vp))
print "gm=%0.2f"%(gm*10**6),'microsec'
from __future__ import division
Idon=10*10**-3
vgs=-12
vgsth=-3
#Id=K*(vgs-vgsth)**2
#Idon=K*(vgs-vgsth)**2
k=Idon/((vgs-vgsth)**2)
print "k=%0.2f"%(k*10**3),'mA'
vgs1=-6
Idon=k*(vgs1-vgsth)**2
print "Idon=%0.2f"%(Idon*10**3),'mA'