Chapter 03 : Diode applications

Example 3.1, Page No 73

In [1]:
import math
#initialisation of variables
Vf=.7
Rl=500.0
Vi=22.0
Vpi=1.414*Vi

#Calculations
Vpo=Vpi-Vf
print(" peak vouput voltage is %3.2fV " %Vpo)
Ip=Vpo/Rl

#Results
print("peak load current is %3.4fA " %Ip)
PIV=Vpi
print("diode paek reverse voltage %3.2fV " %PIV)
 peak vouput voltage is 30.41V 
peak load current is 0.0608A 
diode paek reverse voltage 31.11V 

Example 3.2, Page No 79

In [2]:
import math

#initialisation of variables
Vi=30.0
Rl=300.0
Vf=0.7

#Calculations
Vpi=1.414*Vi
Vpo=Vpi-2*Vf
print(" peak output voltage %.3f V " %Vpo)
Ip=Vpo/Rl

#Results
print(" current bridge is %.1f mA " %(Ip*1000))
 peak output voltage 41.020 V 
 current bridge is 136.7 mA 

Example 3.3 Page No 83

In [3]:
import math

#initialisation of variables
C1=680.0*10**-6
Eo=28.0
Rl=200.0
f=60.0

#Calculations
Il=Eo/Rl
T=1/f
t1=T
Vr=(Il*t1)/C1

#Results
print("peak to peak ripple voltage is %.2f V " %Vr)
peak to peak ripple voltage is 3.43 V 

Example 3.4, Page No 84

In [4]:
import math
#initialisation of variables
Eo=20.0
Rl=500.0
f=60.0

#Calculations
Vr=(10*Eo)/100#10% of Eo
Il=Eo/Rl
T=1/f
t1=T
C1=((Il*t1)/Vr)*10**6

#Results
print("Reservior capacitance is %.2f uF " %C1)
Reservior capacitance is 333.33 uF 

Example 3.5 Page No 85

In [5]:
import math
#initialisation of variables
Eo=20.0
f=60.0
Rl=500.0
Il=Eo/Rl

#Calculations
Vr=(10.0*Eo)/100
print("10percent of Eo is %.2f V " %Vr)
Eomin=Eo-0.5*Vr
Eomax=Eo+0.5*Vr
Q1=math.asin(Eomin/Eomax)
Q1=65
Q2=90-Q1
T=1/f
t2=(Q2*T)/360
print(" charging time is %.2fs " %t2)
t1=T-t2
print("discharging time is %.2fs " %t1)
C1=((Il*t1)/Vr)*10**6

#Results
print("reservior capacitance is %.2f uF " %C1)
10percent of Eo is 2.00 V 
 charging time is 0.00s 
discharging time is 0.02s 
reservior capacitance is 310.19 uF 

Example 3.6 Page No 88

In [6]:
import math

#initialisation of variables
Eo=21.0
Vf=0.7

#Calculations
t1=1.16*10**-3
t2=15.54*10**-3
Vp=Eo+Vf
Vr=2*Vp
Il=40*10**-4
Ifrm=(Il*(t1+t2))/t2
Ifsm=30.0
Rs=Vp/Ifsm

#Results
print(" surge limiting resistance is %3.2fohm " %Rs)
 surge limiting resistance is 0.72ohm 

Example 3.7, Page No 89

In [7]:
import math
#initialisation of variables
Vf=.7
Eo=21.0

#Calculations
Il=40*10**-3
Vp=115.0
Vs=.707*(Vf+Eo)
print(" Vrms voltage is %3.3fV " %Vs)
Is=3.6*Il
print(" rms current is %.2f mA " %(Is*1000))
Ip=(Vs*Is)/Vp

#Results
print("primary current is %.2f mA " %(Ip*1000))
 Vrms voltage is 15.342V 
 rms current is 144.00 mA 
primary current is 19.21 mA 

Example 3.8 Page No 92

In [8]:
import math 

#initialisation of variables
Vr=2.0
T=16.7*10**-3
t2=1.16*10**-3

#Calculations
Il=40.0*10**-3#from example 3.5
t1=(T/2.0)-t2
C1=(Il*t1)/Vr

#Results
print(" resrvior capacitor is %.2f mF " %(C1*10**6))
 resrvior capacitor is 143.80 mF 

Example 3.9 Page No 93

In [9]:
import math
#initialisation of variables
Vr=2.0
T=16.7*10**-3
Il=40.0*10**-3

#Calculations
t1=T/2
C1=(Il*t1)/Vr

#Results
print(" reservior capacitance is %.1fF " %(C1*10**6))
 reservior capacitance is 167.0F 

Example 3.10 Page No 93

In [10]:
import math

#initialisation of variables
Eo=21.0
Vf=0.7
Il=40.0*10**-3
t1=7.19*10**-3
t2=1.16*10**-3

#Calculations
Vp=Eo+(2*Vf)
Vr=Vp
If=Il/2
Ifrm=Il*(t1+t2)/t2
Ifsm=30
Rs=Vp/Ifsm

#Results
print("surge limiting resistance is %.3fohm " %Rs)
surge limiting resistance is 0.747ohm 

Example 3.11, Page No 93

In [11]:
import math

#initialisation of variables
Eo=21.0
Vf=0.7
Il=40*10**-3
Vp=115.0

#Calculations
Vs=0.707*(Eo+2*Vf)
Is=1.6*Il
Ip=(Vs*Is)/Vp

#Results
print(" supply current is %.1f mA " %(Ip*10**3))
 supply current is 8.8 mA 

Example 3.12, Page No 97

In [12]:
import math
#initialisation of variables
Eo=20.0
Il=40.0*10**-3
R1=22.0
Vr=2.0
C1=150*10**-6
C2=C1
fr=120

#Calculations
Vo=Eo-Il*R1
vi=Vr/3.14
Xc2=1/(2*3.14*fr*C2)
vo=(vi*Xc2)/math.sqrt((R1**2) + (Xc2**2))
print(" dc output voltage is %.3fV " %vo)
Vpp=2*vo

#Results
print(" peak to peak voltage is %.1fV " %(Vpp*10**3))
 dc output voltage is 0.238V 
 peak to peak voltage is 475.3V 

Example 3.13, Page No 98

In [13]:
import math
#initialisation of variables
C1=150*10**-6
C2=C1
vi=4.0
vo=1.0
f=120.0

#Calculations
Xc2=8.84           #FROM EXAMPLE 3.12
Xl=Xc2*((vi/vo)+1)
L1=Xl/(2*3.14*f)

#Results
print(" suitable value of L1 is %.3fH " %(L1*10**3))
 suitable value of L1 is 58.652H 

Example 3.14, Page No 101

In [14]:
import math
#initialisation of variables
Edc=20.0
vo=0.24
Vo=20.0
Il=40*10**-3
fr=120.0

#Calculations
Eomax=(3.14*Edc)/2
Epeak=(4*Eomax)/(3*3.14)
vi=Epeak
Rl=Vo/Il
Xlc=(2*Rl)/3
Lc=Xlc/(2*3.14*fr)
L=1.25*Lc
Xl=2*3.14*fr*L
Xc=Xl/((vi/vo)+1)
C1=1/(2*3.14*fr*Xc)

#Results
print("The value of c1 = %.2f mF " %(C1*10**6))
The value of c1 = 180.11 mF 

Example 3.15, Page No 105

In [15]:
import math
#initialisation of variables
Eo=20.0
E0=20-19.7                #load effect

#Calculations
loadregulation =(E0*100)/Eo#percentage
sourceeffect=20.2-20
lineregulation =(sourceeffect*100)/Eo

#Results
print("Line regulation = %.1f percent " %lineregulation)
Line regulation = 1.0 percent 

Example 3.16, Page No 108

In [16]:
import math
#initialisation of variables
Vz=9.1
Izt=20*10**-3
Es=30.0

#Calculations
R1=(Es-Vz)/Izt
Pr1=(Izt**2)*R1
Es=27
Iz=(Es-Vz)/R1

#Results
print("The circuit current is %.2f mA " %(Iz*10**3))
The circuit current is 17.13 mA 

Example 3.17, Page No 110

In [17]:
import math
#initialisation of variables
Vz=6.2
Pd=400.0*10**-3
Es=16.0

#Calculations
Izm=Pd/Vz
R1=(Es-Vz)/Izm
Pr1=(Izm**2)*R1
Izmin=5.0*10**-3
Izmax=Izm-Izmin

#Results
print("maximum current is %3.2f mA " %(Izmax*10**3))
maximum current is 59.52 mA 

Example 3.18, Page No 112

In [18]:
import math
#initialisation of variables
Zz=7.0
Es=16.0
Vo=6.2
Il=59.5*10**-3

#Calculations
es=(10*Es)/100.0                #10% os Es
Rl=Vo/Il
print("es*Zz||Rl/R1+Zz||Rl")
V0=es*((Zz*Rl)/(Zz+Rl))/(R1+((Zz*Rl)/(Zz+Rl)))
lineregulation=(V0*100)/Vo
print("line regulation voltage is %3.3fpercentage " %lineregulation)
V0=Il*((Zz*R1)/(Zz+R1))
loadregulation=(V0*100)/Vo
print("loadregulation voltage is %3.3fpercentage " %loadregulation)
Rr=((Zz*Rl)/(Zz+Rl))/(R1+(Zz*Rl)/(Zz+Rl))

#Results
print("ripple rejection is %3.2f X 10^-2 " %(Rr*10**2))
es*Zz||Rl/R1+Zz||Rl
line regulation voltage is 1.068percentage 
loadregulation voltage is 6.422percentage 
ripple rejection is 4.14 X 10^-2 

Example 3.19, Page No 114

In [19]:
import math
#initialisation of variables

E=9.0
Vf=.7

#Calculations
If=1.0*10**-3
Vo=E-Vf
R1=Vo/If
Vr=E

#Results
print("diode forward voltage is %3.2fohm " %Vr)
print("diode forward current is %3.1fA " %(If*10**3))
diode forward voltage is 9.00ohm 
diode forward current is 1.0A 

Example 3.20, Page No 117

In [20]:
import math
#initialisation of variables
E=5.0
Vo=4.5
Il=2.0*10**-3

#Calculations
R1=(E-Vo)/Il
print(" suitable resistance is %dohm " %R1)
Vr=E
print("when diode is forward baised")
If=(E-Vf)/R1

#Results
print(" diode forward current is %3.2fA " %(If*10**3))
 suitable resistance is 250ohm 
when diode is forward baised
 diode forward current is 17.20A 

Example 3.21, Page No 119

In [21]:
import math
#initialisation of variables
Vo=2.7
Vf=.7
E=9.0
If=1*10**-3

#Calculations
Il=If
Vb=Vo-Vf
R1=(E-Vo)/(Il+If)

#Results
print("resistance is %.2f kOhm " %(R1/10**3))
resistance is 3.15 kOhm 

Example 3.22, Page No 120

In [22]:
import math
#initialisation of variables
Vo=5.0
Vf=0.7
Iz=5.0
Il=1.0
E=20.0

#Calculations
Vz=Vo-Vf
R1=(E-Vo)/(Il+Iz)

#Results
print("zener diode resistance si %.2f ohm " %R1)
#Answer in the book is wrong
zener diode resistance si 2.50 ohm 

Example 3.23, Page No 122

In [23]:
import math
#initialisation of variables
E=10.0
R1=56.0*10**3
f=1000.0
C1=1.0*10**-6

#Calculations
Vo=2*E
Ic=Vo/R1
t=1/(2*f)
Vc=(Ic*t)/C1

#Results
print(" tilt output voltage is %3.2fV " %(Vc*10**3))
 tilt output voltage is 178.57V 

Example 3.24, Page No 124

In [24]:
import math
#initialisation of variables
f=500.0
Rs=600.0
E=8.0

#Calculations
t=1.0/(2*f)
PW=t
C1=PW/Rs
Vo=2.0*E
Vc=(1*Vo)/100#1% of  the Vo
Ic=(Vc*C1)/t
R1=(2*E)/(Ic*1000)

#Results
print("suitable value of R1 is %.2f ohm " %R1)
suitable value of R1 is 60.00 ohm 

Example 3.25, Page No 125

In [25]:
import math
#initialisation of variables
Vf=0.7
E=6.0
Vb1=3.0

#Calculations
Vc=Vb1-Vf-(-E)
Vo=Vb1-Vf
print("when input is -E")
Vo=E+Vc
Vo=Vb1+Vf
print("Capicitor voltage is %.2f ohm " %Vc)
print("when input is +E")
Vo=E+(Vc)

#Results
print("Capicitor voltage is %.2f ohm " %Vo)
when input is -E
Capicitor voltage is 8.30 ohm 
when input is +E
Capicitor voltage is 14.30 ohm 

Example 3.26, Page No 130

In [26]:
import math
#initialisation of variables
E=12.0
Vf=0.7
Rl=47*10**3
f=5000.0

#Calculations
Vo=2*(E-Vf)
Il=Vo/Rl
print(" capacitor discharge time")
t=1.0/(2*f)
print(" for 1% ripple allow .5% due to discharge of C2  %.5%due to discharge of C1")
Vc=(.5*Vo)/100
C2=((Il*t)/Vc)*10**6
print(" value of capacitor C2 is %3.2fuF " %C2)
C1=2*C2

#Results
print("value of capacitor C1 is %3.2fuF " %C1)
 capacitor discharge time
 for 1% ripple allow .5% due to discharge of C2  %.5%due to discharge of C1
 value of capacitor C2 is 0.43uF 
value of capacitor C1 is 0.85uF 

Example 3.27, Page No 133

In [27]:
import math
#initialisation of variables

Vcc=5.0
Vf=.7
R1=3.3*10**3

#Calculations
print("A)")
Ir1=(Vcc-Vf)/R1
print("diode forward current when all input are low is %3.4fA " %Ir1)
print("for each diode")
If=Ir1/3
print("B)")
If2=Ir1/2
If3=If2
print(" forward current when input A is high is %3.5fA " %If3)
print("C)")
If3=Ir1

#Results
print(" forward current when input A and B are high and C is low %3.2fA " %(If3*10**3))
A)
diode forward current when all input are low is 0.0013A 
for each diode
B)
 forward current when input A is high is 0.00065A 
C)
 forward current when input A and B are high and C is low 1.30A