In [1]:

```
from math import pi
im=325./(100+1000) # in A
x1=im*10**3 # in mA
print "(a) Peak value of current, Im = Vm / rf+RL = %0.2f mA"%x1
idc=295.45/pi # in mA
print " Average current, Id.c. = Im / pi = %0.2f mA"%idc
irms=295.45/2 # in mA
print " RMS value of current, Irms = Im / 2 = %0.2f mA"%irms
pdc=((94.046*10**-3)**2)*1000 # in W
print "(b) D.C. power output, Pd.c. = (Id.c.)**2 * RL = %0.2f W"%pdc
pac=((147.725*10**-3)**2)*1100 # in W
print "(c) AC input power, Pac = (Irms)**2 * (rf+RL) = %0.2f "%pac
eta=(8.845/24)*100 # in percentage
print "(d) Efficiency of rectification, eta = Pdc / Pac = %0.2f %%"%eta
```

In [3]:

```
from math import pi
icd=(24./500)*10**3 # in mA
print "Average value of load current, Id.c.= Vdc / RL = %0.2f mA"%icd
im=pi*48 # in mA
print "Maximum value of load current, Im= pi * Idc = %0.2f mA"%im
print "Therefore, maximum ac voltage required at the input,"
vm=550*150.8*10**-3 # in V
print " Vm = Im * (rf+RL) = %0.2f V"%vm
```

In [5]:

```
from math import sqrt,pi
x1=230./5 # in V
vm=sqrt(2) * 46 # in V
vdc=65./pi # in V
im=65./300 # in A
pm=0.217**2 * 300 # in W
idc=20.7/300 # in A
pdc=(0.069**2)*300 # in W
print "(a) The transformer secondary voltage = %0.2f V"%x1
print " Maximum value of secondary voltage, Vm = %0.2f V"%vm
print " Therefore, d.c. output voltage, Vd.c. = Vm / pi = %0.2f V"%vdc
print "(b) PIV of a diode = Vm = 65 V"
print "(c) Maximum value of load current, Im= Vm / RL = %0.2f A"%im
print " Therefore, maximum value of power delivered to the load,"
print " Pm = Im**2 * RL = %0.2f W"%pm
print "(d) The average value of load current, Id.c.(A) = Vdc / RL = %0.2f A"%idc
print " Therefore, average value of power delivered to the load,"
print " Pd.c. = (Idc)**2 * RL = %0.2f W"%pdc
```

In [7]:

```
from math import sqrt,pi
x1=230./5 # in V
vrms=46./2 # in V
vdc=(2.*23*sqrt(2))/pi # in V
idc=(20.7/1000)*10**3 # in mA
pdc=((20.7*10**-3)**2)*900 # in W
piv=2*23*sqrt(2) # in V
vrrms=sqrt(23**2 - 20.7**2) # in V
f=2*60 # in Hz
print "The voltage across the two ends of secondary(in V) = 230 / 5 = %0.2f V"%x1
print "Voltage from center tapping to one end, Vrms = %0.2f V"%vrms
print "(a) d.c. voltage across the load, Vdc = 2Vm / pi = %0.2f V"% vdc
print "(b) d.c. current flowing through the load,"
print " Idc = Vdc / (rs+rf+RL) = %0.2f mA"%idc
print "(c) d.c. power delivered to the load,"
print " Pdc = (Idc)**2 * RL = %0.2f W"%pdc
print "(d) PIV across each diode = 2Vm = %0.2f W"%piv
print "(e) Ripple voltage, Vr,rms = sqrt(Vrms**2 - Vdc**2) = %0.2f V"%vrrms
print " Frequency of ripple voltage = %0.2f Hz"%f
```

In [8]:

```
from math import sqrt,pi
imax=0.8*400 # in mA
print "Therefore, Imax = %0.2f mA"%imax
print "The maximum value of the secondary voltage,"
vm=sqrt(2)*100 # in V
print " Vm = %0.2f V"%vm
print "Therefore, the value of load resistor that gives the largest d.c. power output"
RL=141.4/(320*10**-3)
print " RL = Vm / Imax = %0.2f ohm"%RL
vdc=(2*141.4)/pi
print "(b) D.C.(load) voltage, Vdc(V) = (2*141.4)/pi = %0.2f V"%vdc
idc=90./442
print " D.C. load current, Idc = Vdc / RL = %0.2f A"%idc
print "(c) PIV of each diode = 2Vm = 282.8 V"
```

In [9]:

```
from math import sqrt,pi
print "D.C. power delivered to the load,"
print " Pdc = Vdc**2 / RL"
vdc=sqrt(50.*200)
print "Therefore, Vdc = sqrt(Pdc*RL) = %0.2f V"%vdc
print "The ripple factor, gamma = Vac / Vdc"
print "i.e. 0.01 = Vac / 100"
print "Therefore, the ac ripple voltage across the load, Vac = 1 V"
```

In [10]:

```
from math import sqrt,pi
Vrms=230./4 # in V
vm=sqrt(2)*57.5 # in V
vdc=(2*81.3)/pi # in V
pdc=52.**2/1000 # in W
print "(a) The rms value of the transformer secondary voltage,"
print " Vrms = %0.2f V"%Vrms
print " The maximum value of the secondary voltage"
print " Vm = %0.2f V"%vm,
print "Therefore, d.c. output voltage, Vdc = 2Vm / pi = %0.2f V"%vdc
print "(b) D.C. power delivered to the load,"
print " Pd.c. = (Vdc)**2 / RL = %0.2f W"%pdc
print "(c) PIV across each diode = Vm = 81.3 V"
print "(d) Output frequency = 2 x 50 = 100 Hz"
```

In [11]:

```
L=0.0625/0.04 # in H
print "We know that the ripple factor for inductor filter is gamma = RL / 3*sqrt(2)*omega*L"
print "Therefore, L = %0.2f Henry"%L
```

In [12]:

```
print "We know that the ripple factor for capacitor filter is"
print " gamma = 1 / 4*sqrt(3)*f*C*RL"
c=(0.722)/0.01 # in pF
print "Therefore, C = %0.2f pF"%c
```

In [1]:

```
rl=10./(200*10**-3) # in ohm
lc=1.194/0.02
print "The effective load resistance RL = %0.2f ohm"%rl
print "We know that the ripple factor, gamma = 1.194 / LC"
print "i.e. LC = %0.2f "%lc
print "Critical value of L(mH) = RL / 3*omega = 50 / 3*2*pi*f = 53mH"
print "Taking L = 60 mH (about 20% higher), C will be about 1000 uF"
```

In [14]:

```
from math import sqrt,pi
rl=(10./(200*10**-3)) # in ohm
c2=11.4/0.02
c=sqrt(570.) # in uF
print " RL = %0.2f ohm"%rl
print " 0.02 = 5700 / L*C1*C2*50 = 114 / L*C1*C2"
print "If we assume L = 10 mH and C1 = C2 = C, we have"
print " 0.02 = 114 / L*C**2 = 11.4 / C**2"
print " C**2 = %0.2f "%c2
print "therefore, C = %0.2f uF"%c
```

In [2]:

```
pz=10.*40*10**-3 # in W
print " Pz = Vz * Iz_max = %0.2f W"%pz
print "Hence a 0.5Z 10 zener can be selected"
print "Value of load resistance, RL"
rlmin=10./(50*10**-3) # in ohm
print " RL_min = Vo / IL_max = %0.2f ohm"%rlmin
rlmax=10./(30*10**-3) # in ohm
print " RL_max = Vo / IL_min = %0.2f ohm"%rlmax
print "Value of input resistance, R"
rmax=(30.-10)/((30+40)*10**-3) # in ohm
print " Rmax = Vin(max)-Vo / ILmin+IZmax = %0.2f ohm"%rmax
rmin=(20.-10)/((50+20)*10**-3) # in ohm
print rmin," Rmax(ohm) = Vin(min)-Vo / ILmax+IZmin ="
r=(286+143.)/2
print " R = Rmax+Rmin / 2 = %0.2f ohm"%r # answer in textbook is wrong
```

In [3]:

```
rl=5./(20*10**-3) # in ohm
print " RL = Vo / IL = %0.2f ohm"%rl
r=(8.-5)/((5.+20)*10**-3) # in ohm
print "Hence, the series resistance R(ohm) = Vi(min)-Vo / IZ(min)+IL = %0.2f ohm"%r
print "The various values are given in the Zener regulator shown in Fig. 18.19"
```

In [4]:

```
print "(i) Let IZ = IZ(min) and IL = 0"
print " The total current I = IL + IZ = 10 mA"
r=10./(10*10**-3) # in ohm
print " Therefore, R = %0.2f ohm"%r
print "(ii) For IZ = IZ(max) = 100 mA and IL = 20 mA"
i=20+100. # in mA
print " I = IL + IZ = %0.2f mA"%i
r=10./(120*10**-3)
print " Therefore, R = %0.2f ohm"%r
print "(iii) The range of R varies from 83.33 ohm to 1000 ohm"
```

In [5]:

```
rl=5./(10*10**-3) # in ohm
print "Here, load resistance is RL = Vo / IL = %0.2f ohm"%rl
iz=400./5 # in mA
print "Maximum Zener Current Iz_max = %0.2f mA"%iz
print "The minimum input voltage required will be when Iz = 0. Under this condition,"
print " I = IL = 10 mA"
print "Minimum input voltage Vi_min = Vo + IR"
vi=10.-2 # in V
print "Hence, Vi_min = %0.2f V"%vi
print "or 8 = 5 + (10*10**-3)R"
rmax=3./(10*10**-3) # in ohm
print "Therefore, Rmax = %0.2f ohm"%rmax
print "Now, maximum input voltage, Vi_max = 5 + [(80+10)10**-3]R"
rmin=7./(90*10**-3) # in ohm
print " Rmin = %0.2f ohm"%rmin
print "The value of R is chosen between 77.77 ohm and 300 ohm"
```

In [6]:

```
il=(24./1200)*10**3 # in mA
print "The load current, IL( = Vo / RL = %0.2f mA"%il
iz=600./24 # in mA
print "Max. Zener current, Iz_max = %0.2f mA"%iz
rmax=(32.-24)/((20+25)*10**-3) # in ohm
print " Rmax(ohm) = Vi-Vo / IL_min+IZ_max = %0.2f ohm"%rmax
```

In [7]:

```
vi=15.+3 # in V
print "Refer to fig.18.24. We know that"
print " Vi_min(V) = Vo + 3V = %0.2f V"%vi
vi=18.+1 # in V
print "Assuming the ripple voltage Vr = 2V(max), the input voltage is"
print " Vi = Vi(min) + Vr/2 = %0.2f V"%vi
vz=19./2 # in V
print "Then Vz = Vi /2 = %0.2f V (use the zener diode 1N758 for 10V)"%vz
print "Therefore, Vz = 10 V"
print " Iz = 20 mA"
r1=(19.-10)/(20*10**-3) # in ohm
print " R1 = Vi-Vz / Iz = %0.2f ohm"%r1
print "Let I2 = IB(max) = 50 uA"
r2=((15.-10)/(50*10**-6))*10**-3 # in k-ohm
print " R2 = Vo-Vz / I2 = %0.2f kohm"%r2
r3=(10./(50*10**-6))*10**-3 # in k-ohm
print " R3 = Vz / I2 = %0.2f kohm"%r3
print "Select C1 = 50 uF"
print "Specification of transistor Q1"
vce=19.+1 # in V
print " VCE_max = Vi_max(V) = Vi + Vr/2 = %0.2f V"%vce
print " IE = IL = 50 mA"
p=((19.-15)*50) # in mW
print " P = VCE*IL = (Vi-Vo) * IL = %0.2f mW"%p
print "Use the transistor 2N718 for Q1"
```

In [8]:

```
rlmin=20./(50*10**-3) # in ohm
print "Selection of Zener diode"
print " RLmin = Vo / ILmax = %0.2f ohm"%rlmin
vz=20./2 # in V
print " Vz = Vo / 2 = %0.2f V"%vz
print "The current flowing through the Zener,"
iz=10.+10 # in mA
print " Iz = IE2 + IR1 = %0.2f mA"%iz
pz=10.*20*10**-3 # in W
print " Pz = Vz*Iz = %0.2f W"%pz # > 0.5 W
print "Selection of transistor Q1"
ie1=10.+10+50 # in mA
print " IE1 = IR1 + IR2 + IL = %0.2f mA"%ie1
print " Vi(max) - Vo = 30 -20 = 10 V"
print "For transistor SL100, the rating are"
print " IC(max) = 500 mA"
print " VCE(max) = 50 V"
print " hre = 50 - 280"
print "Hence, SL100 can be chosen for Q1"
print ""
print "Selection of transistor Q2"
vce2=20.6-10 # in V
print " Therefore, VCE2_max = (Vo + VBE1) - Vz = %0.2f V"%vce2
print "For transistor BC107, the rating are"
print " VCEO(max) = 45 V"
print " IC(max) = 200 mA"
print " hFE = 125 - 300"
print "Hence, transistor BC107 is selected for Q2"
print "Selection of resistor R1, R2 and R3"
vr1=20-10. # in V
print " VR1 = Vo - Vz = %0.2f V"%vr1
r1=10./(10) # in k-ohm
print " R1 = VR1 / IR1 = %0.2f kohm"%r1
vr2=20.-10.6 # in V
print " VR2 = Vo - VR3 = %0.2f V"%vr2
r2=9.4/(10*10**-3) # in ohm
print " R2 = VR2 / IR2 = %0.2f ohm"%r2
vr3=10+0.6 # in V
print " VR3 = Vz + VBE2(sat) = %0.2f V"%vr3
r3=10.6/(10*10**-3) # in ohm
print " R3 = VR3 / IR3 = %0.2f ohm"%r3
print "Selection of resistor R4"
vb1=20+0.6 # in V
print " VB1 = VC2(V) = Vo + VBE1 = %0.2f V"%vb1
ib1=70./50 # in mA
print " IB1 = IC1 / beta = %0.2f mA"%ib1
ir4=11.4 # in mA
print " IR4 = IB1 + IC2 = %0.2f mA"%ir4
r4max=(30-20.6)/(11.4*10**-3) # in ohm
print " R4_max = VR4(max) / IR4 = Vi(max)-VB1 / IR4 = %0.2f ohm"%r4max
r4min=(22-20.6)/(11.4*10**-3) # in ohm
print " R4_min = VR4(min) / IR4 = Vi(min)-VB1 / IR4 = %0.2f ohm"%r4min
r4=(825.+123)/2 # in ohm
print " R4 = R4(max)+R4(min) / 2 = %0.2f ohm"%r4
```

In [22]:

```
from math import sqrt,pi
print "A bridge rectifier or full wave rectifier is used to get the pulsating d.c. output."
rl=9./(100*10**-3) # in ohm
print " RL = Vdc / TL = %0.2f ohm"%rl
print "A capacitor filter is used to remove the ripple and get a smooth output."
print " Ripple factor gamma = 1 / 4*sqrt(3)*f*C*RL"
print "Assume the ripple factor to be 0.03"
c=(1./(4*sqrt(3)*50*0.03*90))*10**6 # in uF
print " C = %0.2f uF"%c # = 1000 uF
print "The short circuit resistance Rsc connected with the series pass transistor is"
rsc=0.7/(150*10**-3) # in ohm
print " Rsc = VBE / Ilim_it = %0.2f ohm"%rsc
print "Assume 7.6 V Zener diode in series with 1.5 k-ohm"
print "The designed circuit is shown in fig.18.32."
```