import math
from __future__ import division
#initialisation of variables
n=1
k=1.38 #x 10^-23
#CALCULATIONS
T=25+273
q=1.6 #x 10^-19
vd=((k*T)/(1.6*(10**4))*4.6151)
#RESULTS
print"what range of forward voltage drop vD can (2.1) be approximated";
print"vd =",round(vd,3),"V";
import math
from __future__ import division
#initialisation of variables
iD2=(47.73*10) #mA
#RESULTS
print"find the forward and reverse saturation current";
print"iD2=",iD2;
print"iD1/(e^(0.3/0.02587)-1)=91nA";
import math
from __future__ import division
#initialisation of variables
Rl=100 #kΩ
Rs=10 #kΩ
#CALCULATIONS
Vl=(Rl/(Rl+Rs))
#RESULTS
print"find the value of Vl";
print"The value of Vl =",round(Vl,3),"vs";
import math
from __future__ import division
#initialisation of variables
Vs=5 #V
V2=3 #V
#CALCULATIONS
iD2=((Vs-V2)/500)*1000 #mA
#RESULTS
print"In the circuit D1 and D2 are ideal diodes. Find iD1 and iD2.";
print"iD2=",round(iD2),"mA";
import math
from __future__ import division
#initialisation of variables
vs=0.1 #cos wtV
Vb=2 #V
#CALCULATIONS
Rth=(100**2)/200 #kΩ
Rf=(0.7-0.5)/0.004
#RESULTS
print"Find iD and vD analytically";
print"(100/200)*(2+0.1cos wt) V";
print"Rth=",round(Rth,3),"ohm";
print"Rf=",round(Rf,3),"ohm";
import math
from __future__ import division
#initialisation of variables
Idq=5 #mA
Vdq=0.75 #V
vh=0.05 #cos wt
Rth=50 #kΩ
rd=50
#CALCULATIONS
rd=(0.7-0.5)/0.004
id=(vh/(Rth+rd))*1000
vd=(rd*id)/1000 #cos wt V
#RESULTS
print"Use the small-signal technique to find iD and vD";
print"rd=",rd,"ohm";
print"id=",round(id,3),"cos wt mA";
print"vd=",round(vd,3),"cos wt V";
print"iD = Idq + id = 5+0.5 cos wt mA";
print"vD = Vdq + vd = 0.75+0.025 cos wt V ";
import math
from __future__ import division
#initialisation of variables
Rs=200 #Ω
R1=200 #Ω
Rl=50 #kΩ
vs=400 #sin wt V
#CALCULATIONS
vth=(R1/(R1+Rs))*vs
Rth=((R1*Rs)/(R1+Rs))
id=-2*10**(-6)
Rl=Rl*(10**3)
vD=vth-(id)*(Rth+Rl)
#RESULTS
print"vth =",round(vth,3),"sin wt V";
print"Rth =",round(Rth,3),"ohm";
print"vD =",round(vD,3),"V";
import math
from __future__ import division
#initialisation of variables
Vf1=1 #v
Vf2=2 #v
Rf1=100 #Ω
Rf2=200 #Ω
Vb1=4 #v
Vb2=6 #v
R=2000
#CALCULATIONS
V01=Vf2+((Vb1-Vf1-Vf2)*Rf2)/(R+Rf1+Rf2)
V02=Vf2+((Vb2-Vf1-Vf2)*Rf2)/(R+Rf1+Rf2)
Reg=((V02-V01)/V01)*100
#RESULTS
print"V01 is=",round(V01,3),"and",round(V02,3);
print"Reg =",round(Reg,3);
import math
from __future__ import division
#initialisation of variables
Rl=10 #Ω
Rs=10 #Ω
Vs=10 #v
Vl01=2.5 #V
Rl1=1000
Vs1=10
Rs1=10
Vl02=4.9 #V
#CALCULATIONS
Vl=(Rl/(Rl+Rs))*Vs #V
Vl1=(Rl1/(Rl1+Rs1))*Vs1
Reg=((Vl02-Vl01)/Vl01)*100
#RESULTS
print"Vl =",round(Vl,3);
print"For Rl=1000";
print"Vl1 =",round(Vl1,3);
print"Reg =",round(Reg);
import math
from __future__ import division
#initialisation of variables
Rl=10 #Ω
Rs=10 #Ω
Vs=-10 #v
Vl0=2.5 #V
#CALCULATIONS
Vl=(Rl/(Rl+Rs))*Vs
#RESULTS
print"Vl =",round(Vl,3);
print"Vl0 =",round(Vl0,3);
import math
from __future__ import division
#initialisation of variables
R1=6 #kΩ
R2=3 #kΩ
V1=5 #v
V2=10 #v
#CALCULATIONS
Rth=(R1*R2/(R1+R2))
R2=(R1*Rth/(R1-Rth))
#RESULTS
print"Rth =",round(Rth,3);
print"R2 =",round(R2,3);
import math
from __future__ import division
#initialisation of variables
Vz=8.2 #V
Rl=9 #kΩ
iZ=1
Vb=13.2
Vb1=11.7
#CALCULATIONS
iL=Vz/Rl #mA
Rs=((Vb-Vz)/(iZ+iL))
iZ1=((Vb1-Vz)/Rs)-iL
#RESULTS
print"iL =",round(iL,3),"A";
print"Rs =",round(Rs,3),"ohm";
print"iZ =",round(iZ1,3);
import math
from __future__ import division
#initialisation of variables
Vz=5.2 #V
Pdmax=260 #mW
Vs=15
#CALCULATIONS
iZmax=Pdmax/Vz #mA
R=(Vs-Vz)*1000/iZmax
#RESULTS
print"iZmax =",round(iZmax,3),"mA";
print"R =",round(R,3),"ohm";