VGS=12.
IG=10**-9
GSR=VGS/IG
GSR1=GSR*10**-6
print "VGS = 12 V, IG = 10**-9 A"
print "Therefore, gate-to-source resistance = VGS / IG =%0.2f Mohm"%GSR1
delta_VGS=0.1
delta_ID=0.3*10**-3
print "delta_VGS = 4 - 3.9 = 0.1 V"
print "delta_ID = 1.6 - 1.3 = 0.3 mA"
gm=delta_ID/delta_VGS
gm1=gm*10**3
print "Therefore, transconductance, gm = delta_ID / delta_VGS =%0.2f m-mho"%gm1
from math import sqrt
VGSoff=-6
IDSS=8
ID=4
print "ID = IDSS*[1 - (VGS/VGS_off)]**2"
VGS=(1-sqrt(ID/IDSS))*VGSoff
print "Therefore, VGS =%0.2f V"%VGS
VP=abs(VGSoff)
print "VP = |VGS_off| = %0.2f V"%VP
VGS=-2
VP=-5
IDSS=8*10**-3
print "The minimum value of VDS for pinch-off to occur for VGS = -2 V is"
VDSmin=VGS-VP
print "VDSmin = VGS - VP =%0.2f V"%VDSmin
IDS=IDSS*(1-(VGS/VP))**2
IDS1=IDS*10**3
print "IDS = IDSS * [1-(VGS/VP)]**2 =%0.2f mA"%IDS1
IDSS=10*10**-3
VGS=-3
ID=4*10**-3
VDD=20.
print "The value of drain current at Q-point,"
IDQ=IDSS/2
IDQ1=IDQ*10**3
print "IDQ = IDSS / 2 =%0.2f mA"%IDQ1
print "and the value of drain-to-source at Q-point,"
VDSQ=VDD/2.
print "VDSQ = VDD / 2 = %0.2f V"%VDSQ
print "Therefore, the operating point is at:"
print "VDS =%0.2f V"%VDSQ
print "ID(mA) =%0.2f mA"%IDQ1
RD=(VDD-VDSQ)/ID
RD1=RD*10**-3
print "Therefore, RD = %0.2f kohm"%RD1
print "The source voltage or voltage across the source resistor RS is"
VS=-VGS
print " VS = -VGS = -3 V"
print "Also,VS = ID*RS "
RS=VS/ID
print "Therefore, RS = %0.2f ohm"%RS
IDSS=40*10**-3
VP=-10
VGSQ=-5
print "We know that, ID = IDSS * [1 - (VGS/VP)]**2"
print "Substituting the given values, we get"
ID = IDSS*(1-(VGSQ/VP))**2
ID1=ID*10**3
print " ID =%0.2f mA"%ID1
RS=abs(VGSQ/ID)
print "Therefore, RS = |VGSQ / ID| =%0.2f ohm"%RS
from sympy import symbols,solve
VDD=24.
R2=8.57*10**6
R1=12*10**6
VP=-2
IDSS=4*10**-3
RD=910.
RS=3*10**3
print "From fig.7.13.,"
VGG=round(VDD*(R2/(R1+R2)))
print " VGG = VDD*(R2 / (R1+R2)) = %0.2f V"%VGG
x=symbols('x')
p1=solve(9*x**2-73*x+144,x)
ans1=p1[0]
ans2=p1[1]
print "Therefore, ID=%0.2f or %0.2f mA"%(ans1,ans2)
print "As ID = 4.72mA > 4mA = IDSS, this value is inappropriate. So, IDQ=3.39 mA is selected."
print "Therefore,"
IDQ=3.39*10**-3
VGSQ=VGG-(IDQ*RS)
print " VGSQ = VGG - (IDQ*RS) =%0.2f V"%VGSQ
VDSQ=VDD-(IDQ*(RD+RS))
print "and VDSQ = VDD - (IDQ*(RD+RS)) =%0.2f V"%VDSQ
VDGQ = VDSQ - VGSQ
print "Then, VDGQ = VDSQ - VGSQ = %0.2f V"%VDGQ
print "which is grater than |VP| = 2 V. Hence, the FET is in the pinch-off region."
from math import sqrt
IDSS=10*10**-3
VP=-3.5
Rth=120*10**3 #R1+R2=120 k-ohm
ID=5*10**-3
VDS=5
RS=0.5*10**3
print "Assume that the JFET is biased in the saturation region. Then the dc drain current is given by"
print " ID = IDSS*(1-(VGS/VP))**2"
VGS=VP*(1-(sqrt(ID/IDSS)))
print "Therefore, VGS = %0.2f V"%VGS
# textbook answer is wrong
print "The voltage at the source terminal is"
VS=(ID*RS)-5
print " VS = (ID*RS) - 5 = %0.2f V"%VS
print "The gate voltage is"
VG=VGS+VS
print " VG = VGS + VS = %0.2f V"%VG
print "The gate voltage is"
print " VG = ((R2 / (R1 + R2))*10) - 5"
R2=(Rth*(VG+5))/10
R2_1=R2*10**-3
print "Therefore, R2 = %0.2f kohm"%R2_1
# textbook answer is wrong
R1=Rth-R2
R1_1=R1*10**-3
print "and R1(k-ohm) = %0.2f kohm"%R1_1
# textbook answer is wrong
print "The drain-to-source voltage is"
print "VDS = 5 - ID*RD - ID*RS - (-5)"
RD=(10-VDS-(ID*RS))/ID
RD1=RD*10**-3
print " RD = %0.2f kohm"%RD1
x=VGS-VP
print "VGS - VP = %0.2f "%x # textbook has taken a different value hence the wrong answer in textbook
print "Here, since VDS > (VGS-VP), the JFET is biased in the saturation region, which satisfies the initial assumption"
from math import sqrt
KN=1*10**-3
lamda=0.01
Ri=100*10**3
IDt=4*10**-3
IDQ=1.5*10**-3
VTN=1.5
VDD=12.
VDSQ=7.
VGSt=sqrt(IDt/KN)+VTN
print "VGSt = %0.2f V"%VGSt
print "Therefore,"
VDSt=VGSt-VTN
print " VDSt = VGSt - VTN = %0.2f V"%VDSt
RD=(VDD-VDSQ)/IDQ
RD1=RD*10**-3
print "Therefore, RD(k-ohm) = (VDD - VDSQ) / IDQ = %0.2f kohm"%RD1
print "Then, IDQ = KN*(VGSQ-VTN)**2"
VGSQ=(sqrt(IDQ/KN))+VTN
print "Therefore, VGSQ = %0.2f V"%VGSQ
R1=1200/2.73
print " R1 = %0.2f kohm"%R1
R2=R1/((12/2.73)-1)
print " R2 = %0.2f kohm"%R2
VTN=-2
KN=0.1*10**-3
VDD=5
RS=5*10**3
VGS=0
ID=KN*(-VTN)**2
ID1=ID*10**3
print "ID = %0.2f mA"%ID1
print "The d.c. drain-to-source voltage is"
VDS=VDD-(ID*RS)
print " VDS = VDD - ID*RS = %0.2f V"%VDS
VDSsat=VGS-VTN
print "Then, VDSsat = VGS - VTN = %0.2f V"%VDSsat
print "Since VDS > VDSsat, the MOSFET is biased in the saturation region"