%matplotlib inline
# variable declaration
V_GS_off=-4; # voltage in volt
I_DSS=12*10**-3; # current in ampere
R_D=560; # resistance in ohm
#calculation
V_P=-1*V_GS_off; # volt
V_DS=V_P; # Vds in volt
I_D=I_DSS; # current accross resistor
V_R_D=I_D*R_D; #voltage across resistor
V_DD=V_DS+V_R_D; # Vdd in volt
# result
print "The value of V_DD required to put the device in the constant"
print " current area of operation of JFET = %.2f volt" %V_DD
print('The p-channel JFET requires a positive gate to source voltage.')
print('The more positive the voltage, the lesser the drain current.')
print('Any further increase in V_GS keeps the JFET cut off, so I_D remains 0')
I_DSS=9.0*10**-3;
V_GS_off=-8.0;
V_GS=0.0;
I_D=9.0*10**-3
I_D=I_DSS*(1-(V_GS/V_GS_off))**2;
print('Value of I_D for V_GS=0V is %f A '%I_D)
V_GS=-1.0
I_D=I_DSS*(1-(V_GS/V_GS_off))**2;
print('Value of I_D for V_GS=-1V is %f A'%I_D)
V_GS= -4.0
I_D=I_DSS*(1-(V_GS/V_GS_off))**2;
print('Value of I_D for V_GS=-4V is %f A'%I_D)
#Variable Declaration
I_DSS=3.0*10**-3;
V_GS_off=-6.0;
y_fs_max=5000.0*10**-6;
V_GS=-4.0;
g_m0=y_fs_max;
#Calculation
g_m=g_m0*(1-(V_GS/V_GS_off));
I_D=I_DSS*(1-(V_GS/V_GS_off))
#Result
print('forward transconductance = %f Siemens'%g_m)
print('value of I D = %f A'%I_D)
# variable declaration
V_GS=-20.0; # voltage in volt
I_GSS=-2*10**-9; # current in ampere
#calculation
R_IN1=abs((-20/(2*10**-9))) # resistance in ohm
R_IN=R_IN1/(10**9)
# result
print "Input resistance = %d Giga ohm" %R_IN
# variable declaration
V_DD=15; # voltage in volt
V_G=0; # voltage in volt
I_D=5*10**-3; # current in ampere
R_D=1*10**3; # resistance in ohm
R_G=10*10**6; # resistance in ohm
R_S=220; # resistance in ohm
# calculation
V_S=I_D*R_S; # source voltage in volt
V_D=V_DD-I_D*R_D; # drain voltage in volt
V_DS=V_D-V_S; # drain to source voltage in volt
V_GS=V_G-V_S; # gate to source voltage in volt
# result
print "Drain to source voltage = %.2f volts" %V_DS
print "Gate to source voltage = %.2f volts" %V_GS
# variable declaration
V_GS=-5.0; # voltage in volt
I_D=6.25*10**-3; # current in ampere
#calculation
R_G=abs((V_GS/I_D)) # resistance in ohm
# result
print "Gate resistance = %d ohm" %R_G
I_DSS=25.0*10**-3;
V_GS_off=15.0;
V_GS=5.0;
I_D=I_DSS*(1-(V_GS/V_GS_off))**2
R_S=abs((V_GS/I_D))
print('Drain current = %f Amperes'%I_D)
print('Source resistance = %.0f Ohms'%R_S)
# variable declaration
V_D=6; # drain voltage in volt
V_GS_off=-3; # off voltage in volt
V_DD=12; # voltage in volt
I_DSS=12*10**-3; # current in ampere
#calculation
I_D=I_DSS/2; #MIDPOINT BIAS
V_GS=V_GS_off/3.4; #MIDPOINT BIAS
R_S=abs((V_GS/I_D)) #resistance i voltage
R_D=(V_DD-V_D)/I_D #resistance in voltage
# result
print "Source resistance = %.2f ohm" %R_S
print "Drain resistance = %d ohm" %R_D
import pylab
import numpy
# variable declaration
R_S=680.0; # resistance in ohm
I_D=0; # current in ampere
#calculation
V_GS=I_D*R_S; #FOR I_D=0A
I_DSS=4*10**-3; # current in ampere
I_D=I_DSS; # currents are equal
V_GS1=-1*I_D*R_S; #FOR I_D=4mA
# result
print "V_GS at I_D=0amp is %d volt" %V_GS
print "V_GS at I_D=4mA is %.2f volt" %V_GS1
print "Plotting load line using the values of V_GS at I_D=0 and 4mA,"
print " we find the intersection of load line with transfer characteristic"
print " to get Q-point values of V_GS=-1.5V and I_D=2.25mA"
#########PLOT######################
idss=4
vgsoff=-6
vgs=arange(-6.0,0.0,0.0005)
idk=arange(0.0,4.0,0.0005)
ids=arange(0.0,2.25,0.0005)
vgsk=-idk*0.68
i_d=idss*(1-(vgs/vgsoff))**2
text(-3.00,2.25,'Q Point',size=13)
text(-3.25,2,'(-1.5V, 2.25mA)')
plot(vgs,i_d)
plot(vgsk,idk,'b')
plot(-1.5,2.25,'o')
ylim( (0,5) )
title('Transfer characteristic curve')
xlabel('Vgs')
ylabel('Idss')
# variable declaration
V_DD=12; # voltage in volt
V_D=7; # voltage in volt
R_D=3.3*10**3; # resistance in ohm
R_S=2.2*10**3; # resistance in ohm
R_1=6.8*10**6; # resistance in ohm
R_2=1*10**6; # resistance in ohm
#calculation
I_D=(V_DD-V_D)/R_D; # drain current in ampere
V_S=I_D*R_S; # source voltage in volt
V_G=(R_2/(R_1+R_2))*V_DD; # gate voltage in volt
V_GS=V_G-V_S; # gate to source voltage in volt
# result
print "Drain Current = %.4f Ampere" %I_D
print "Gate to source voltage = %.4f volts" %V_GS
# variable declaration
R_1=2.2*10**6; # resistance in ohm
R_2=R_1; # resistance in ohm
V_DD=8; # voltage in volt
R_S=3.3*10**3; # resistance in ohm
#calculation
V_GS=(R_2/(R_1+R_2))*V_DD; #FOR I_D=0A
V_G=V_GS; # voltage in volt
I_D=(V_G-0)/R_S; #FOR V_GS=0V
# result
print "V_GS = %d volt" %V_GS
print "at V_GS=0V. I_D = %.4f ampere" %I_D
print "Plotting load line using the value of V_GS=4V at I_D=0"
print " and I_D=1.2mA at V_GS=0V, we find the intersection of"
print " load line with transfer characteristic to get Q-point"
print " values of V_GS=-1.8V and I_D=1.8mA"
I_DSS=10.0*10**-3;
V_GS_off=-8.0;
V_GS=-3.0;
I_D=I_DSS*(1-(V_GS/V_GS_off))**2;
print('Drain current when V_GS=-3V is %f Amperes'%I_D)
V_GS=3;
I_D=I_DSS*(1-(V_GS/V_GS_off))**2;
print('Drain current when V_GS=3V is %f Amperes'%I_D)
#variable Declaration
I_D_on=500.0*10**-3;
V_GS=10.0;
V_GS_th=1.0;
K=I_D_on/((V_GS-V_GS_th)**2)
V_GS=5.0;
I_D=K*(V_GS-V_GS_th)**2;
print('Drain current = %f A'%I_D)
# variable declaration
I_DSS=12*10**-3; # currenin ampere
V_DD=18; # voltage in volt
R_D=620; # resistance in oh
#calculation
I_D=I_DSS; # currents are equal
V_DS=V_DD-I_D*R_D; # drain to source voltage
# result
print "Drain to sorce voltage = %.2f volt" %V_DS
#variable Declaration
I_D_on=200.0*10**-3;
V_DD=24.0;
R_D=200.0;
V_GS=4.0;
V_GS_th=2.0;
R_1=100.0*10**3;
R_2=15.0*10**3;
#Calculation
K=I_D_on/((V_GS-V_GS_th)**2)
V_GS=(R_2/(R_1+R_2))*V_DD;
I_D=K*(V_GS-V_GS_th)**2;
V_DS=V_DD-I_D*R_D;
#Result
print('Drain to Source voltage = %f V'%V_DS)
print('Gate to Source voltage = %f V'%V_GS)
# variable declaration
V_GS_on=3; # voltage in volt
V_GS=8.5 #voltage displayed on meter
V_DS=V_GS; # voltages are equal
V_DD=15; # voltage in volt
R_D=4.7*10**3; # resistance in ohm
#calculation
I_D=(V_DD-V_DS)/R_D; # drain current
# result
print "Drain current = %.4f ampere" %I_D