from __future__ import division
from math import exp
IR=50*10**(-9)
print "IR = %0.2e "%(IR)," ampere" # value of Reverse saturation current
VT=26*10**(-3)
print " Thermal voltage,VT= %0.2f "%(VT),"volt"
VAK1=(-0.25)# diode junction voltage
print "Junction voltage,VAK1= %0.2f"%(VAK1),"volt"
IA =IR*(exp(VAK1/(2*VT))-1)# formulae for diode current
print "Diode current,IA =IR*(exp(VAK1/(2*VT))-1)= %0.2e "%(IR*(exp(VAK1/(2*VT))-1))," ampere" # calculation
VAK2=(+0.25)
print "Junction voltage,VAK2= %0.2f"%(VAK2),"volt"
IA =IR*(exp(VAK2/(2*VT))-1)
print "Diode current,IA =IR*(exp(VAK2/(2*VT))-1)= %0.2e "%(IA)," ampere" # calculation
VAK3=(+0.5)
print "Junction voltage,VAK3= %0.2f"%(VAK3),"volt"
print "Diode current,IA =IR*(exp(VAK3/(2*VT))-1)= %0.2e "%(IR*(exp(VAK3/(2*VT))-1))," ampere" # calculation
VAK4=(+0.6)
print "Junction voltage,VAK4= %0.2f"%(VAK4),"volt"
print "Diode current,IA =IR*(exp(VAK4/(2*VT))-1)= %0.2f "%(IR*(exp(VAK4/(2*VT))-1))," ampere" # calculation
VAK5=(+0.7)
print "Junction voltage,VAK3= %0.2f"%(VAK5),"volt"
print "Diode current,IA =IR*(exp(VAK5/(2*VT))-1)= %0.2f "%(IR*(exp(VAK5/(2*VT))-1))," ampere" # calculation
VAK6=(+0.8)
print "Junction voltage,VAK3= %0.2f"%(VAK6),"volt"
print "Diode current,IA =IR*(exp(VAK6/(2*VT))-1)= %0.2f "%(IR*(exp(VAK6/(2*VT))-1))," ampere" # calculation
from __future__ import division
VF=5
print "source voltage,VF = %0.2f "%(VF)+ " volts"#initialization
VD=0.7
print "voltage drop,VD = %0.2f "%(VD)+ " volts"#initialization
R=5*10**(3)
print "resistance,R = %0.2f "%(R)+ "ohm"#initialization
RF=100
print "resistance,R = %0.2f "%(RF)+ "ohm"#initialization
VR=0.6
print "VR = %0.2f "%(VR)+ " volts"#initialization
IA=(VF-VD)/R #formulae
print "Diode current ,IA = %0.2f "%(IA)," ampere" # calculation
IA=(VF-VR)/(R+RF)# Formulae
print " using large signal model,IA = %0.2e "%(IA)," ampere" # calculation
VAK=(VR+IA*RF)# Formulae
print "Junction voltage,VAK = %0.2f"%(VAK)," volts"#calculation
from math import exp
from __future__ import division
VT=26*10**(-3)
print " Thermal voltage,VT= %0.2f "%(VT)," volt"#initialization
IR=50*10**(-9)
print "IR = %0.2f "%(IR)," ampere" # value of Reverse saturation current
VAK1=(0.7)# diode junction voltage
print "Junction voltage,VAK1= %0.2f"%(VAK1)," volt"#initialization
gf=(IR/(2*VT))*exp(VAK1/(2*VT)) #Formulae
print "Forward conductance,gf= %0.2f"%(gf)," mho"
rf=1/gf #Formulae
print "Forward resistance,rf = %0.2f "%(rf)+ " ohm"
VAK2=(-0.7)
gr=(IR/(2*VT))*exp(VAK2/(2*VT)) #Formulae
print "Reverse conductance,gr= %0.2e"%(gr)," mho"
rr=1/gr #Formulae
print " Reverse resistance,rr = %0.2e "%(rr)+ " ohm"
from math import sqrt,pi
Vi=10
print "input voltage,Vi = %0.2f "%(Vi)," volts" #initialization
Rs=0.2
print "resistance,Rs = %0.2f "%(Rs)+ "ohm" #initialization
RL=10
print "resistance,RL = %0.2f "%(RL)+ "ohm" #initialization
VD=0.7
print "input voltage,VD = %0.2f "%(VD)," volts" #initialization
Vim=Vi*sqrt(2) #Formulae
Iim=(Vim-VD)/(RL+Rs) #Formulae
print " Peak load current ,Iim =(Vim-VD)/(RL+Rs) = %0.2f"%(Iim)," ampere" # calculation
Ildc=(2*Iim/(pi)) #Formulae
print " D.C load current ,Ildc =(2*Iim/(pi)) = %0.2f"%(Ildc)," ampere" # calculation
Iadc=(Ildc/2) #Formulae
print " diode d.c current ,Iadc =(Ildc/2)= %0.2f "%(Iadc)," ampere" # calculation
PIV=2*Vim #Formulae
print "peak inverse voltage ,PIV = 2*Vim= %0.2f"%(PIV)," volts" # calculation
Vldc=Ildc*RL #Formulae
print "D.C output voltage,Vldc=Ildc*RL= %0.2f "%(Vldc)," volts" # calculation
from math import sqrt,pi
Idc=1*10**(-3)
print " D.C load current ,Idc = %0.2e "%(Idc)," ampere" #initialization
Vi=2.5
print "input voltage,Vi = %0.2f "%(Vi)," volts"#initialization
Vim=Vi*sqrt(2)
VD=0.7
print "voltage drop,VD = %0.2f "%(VD)+ " volts" #initialization
Rm=50
print "resistance,Rm = %0.2f "%(Rm)+ " ohm" #initialization
R=((2/pi)*((Vim-2*VD)/Idc)-Rm) #Formulae
print "resistance,R =[(2/pi)*((Vim-2*VD)/Idc)-Rm]= %0.2f "%(R)+ " ohm"
# NOTE: VALUE OF R=1310 ohm as given in book but here calculated ans is 1309.5231ohm
from math import sqrt,pi
Vi=10
print "input voltage,Vi = %0.2f "%(Vi)," volts" #initialization
Vim=Vi*sqrt(2)
f1=50
print "frequency,f1= %0.2f"%(f1)," hertz" #initialization
RL=1100
print "resistance,RL = %0.2f "%(RL)+ " ohm" #initialization
C=50*10**(-6)
r=1/((4*sqrt(3))*f1*RL*C) # Formulae
print "Ripple factor,r = %0.2f "%(r),""
x=1/(4*f1*RL*C) # Formulae
VLDC=Vim/(1+x) # Formulae
print "output voltage,VLDC = VLDC=Vim/(1+x)= %0.2f"%(VLDC)," volts" #calculation
VR=(Vim-VLDC)/(VLDC) # Formulae
print " voltage Regulation,VR =(Vim-VLDC)/(VLDC)= %0.2f "%(VR)," volts" #calculation
Vr=VLDC*r # Formulae
print "Ripple output voltage,Vr = Vr=VLDC*r= %0.2f"%(Vr)," volts"#calculation
VI=10
print "input voltage,VI = %0.2f "%(VI)," volts" #initialization
Vz=5
print "diode voltage,Vz = %0.2f "%(Vz)," volts" #initialization
Rz=100
print "resistance,Rz = %0.2f "%(Rz)+ " ohm" #initialization
RD=500
print "resistance,RD = %0.2f "%(RD)+ " ohm" #initialization
DVI=25
print "percentage change in VI,DVI= %0.2f "%(DVI)," volts" #initialization
DVL=(DVI)*(Rz/(RD+Rz)) #Formulae
print "percentage change in VL,DVL=(DVI)*(Rz/(RD+Rz))= %0.2f "%(DVL)," %"
R0=(RD*Rz)/(RD+Rz) #Formulae
print "Output resistance,R0 =(RD*Rz)/(RD+Rz)= %0.2f "%(R0)+ " ohm"
VImax=12.5
Izmax=(VImax-Vz)/(RD+Rz) #Formulae
print "resistance,RD = %0.2f "%(RD)+ " ohm"
PZmax=(Izmax*Vz) #Formulae
print "Power dissipated,PZmax =PZmax=(Izmax*Vz)= %0.2f "%(PZmax)+ " watt"
Prd=(Izmax*Izmax*RD) #Formulae
print "Power dissipated,Prd=Prd=(Izmax*Izmax*RD)= %0.2f "%(Prd)+ " watt"
PD=(PZmax+Prd) #Formulae
print "Power dissipated,PD = %0.2f "%(PD)+ " watt"
RL=0.5*(10**3)
print "resistance,RL = %0.2f "%(RL)+ " ohm" #initialization
P_VR=(R0*100)/RL #Formulae
print " voltage Regulation Percentage,%%VR =(R0/RL)*(100)= %0.2f "%(P_VR),"% "
Vz=10 #initialization
print "diode voltage,Vz = %0.2f "%(Vz)," volts"
TC1=(10*0.02)/(100) #calculation
print " Zener diode TC1 = %0.2e "%(TC1)," V/degree celsius"
VD=0.7
print " voltage drop,VD = %0.2f "%(VD)," volts"
TC2=(-2.5*10**(-3)) #calculation
print "Si diode TC = %0.2f "%(TC2)," V/degree celsius"
Vref1=VD+Vz
print "Combined voltage ,Vref=VD+Vz= %0.2f "%(Vref1)," volts"
TC3=(TC1+TC2) #calculation
print " Combined TC = %0.2f "%(TC3)," V/degree celsius"
TC=(TC1+TC2)*100/(Vref1) #calculation
print "New Combined TC = (TC1+TC2)*100/(Vref1)= %0.2e"%(TC)," percent/degree celsius"
T1=25#temperature
T2=50# new temperature
Vref=Vref1-((-TC3)*(T2-T1))#calculation
print "New Combined reference voltage ,Vref= Vref1-((-TC3)*(T2-T1))= %0.2f"%(Vref)," volts"
Vi1=0.2
print "input voltage,Vi1 = %0.2f "%(Vi1)," volts" #initialization
VD=0.7
print " voltage drop,VD = %0.2f "%(VD)," volts" #initialization
RL=5*(10**3)
print "resistance,RL = %0.2f "%(RL)+ " ohm" #initialization
Vcc=5
print "Supply voltage,Vcc = %0.2f "%(Vcc)," volts"
V01=VD+Vi1 #Formulae
print "output voltage ,V01 ==VD+Vi1 = %0.2f "%(V01)," volts"
IL1=(Vcc-V01)/RL #Formulae
print " output current ,IL1=IL1=(Vcc-V01)/RL = %0.2e "%(IL1)," ampere" # calculation
Vi2=5
print "input voltage,Vi2 = %0.2f "%(Vi2)," volts" #initialization
V02=3*VD #Formulae
print "output voltage ,V02 =3*VD= %0.2f "%(V02)," volts"
IL2=(Vcc-V02)/RL #Formulae
print " output current ,IL2= IL2=(Vcc-V02)/RL = %0.2e "%(IL2)," ampere" # calculation
VAK=V02-Vi2 #Formulae
print " Diode voltage ,VAK = V02-Vi2 = %0.2f "%(VAK)," volts"
#NOTE:correct value of IL2=0.58 mA but in book given as 0.592mA