In [1]:

```
import math
#Variables
V1 = 230.0 #Primary voltage (in volts)
N2byN1 = 1.0/10 #Turns ratio
#Calculation
V2 = V1 * N2byN1 #Secondary voltage (in ratio)
Vm = 2**0.5 * V2 #Maximum value of secondary voltage (in volts)
Vdc = 0.318 * Vm #dc output voltage (in volts)
PIV = Vm #Peak inverse voltage (in volts)
#Result
print "dc output voltage is ",round(Vdc,1)," V.\nPIV of the diode is ",round(PIV,1)," V."
```

In [2]:

```
import math
#Variables
RL = 20 #Load resistance (in kilo-ohm)
V2 = 24 #Secondary voltage (in volts)
#Calculation
Vm = 2**0.5 * V2 #Maximum value of secondary voltage (in volts)
Im = Vm / RL #Maximumj value of load current (in milli-Ampere)
Idc = 0.318 * Im #dc current (in milli-Ampere)
#Result
print "The value of dc load current is ",round(Idc,3)," mA."
```

In [3]:

```
import math
#Variables
V1 = 230 #Primary voltage (in volts)
N2byN1 = 1.0/2.0 #Turns ratio
RL = 200 #Resistance (in ohm)
#Calculation
V2 = V1 * N2byN1 #Secondary voltage (in volts)
Vm = 2**0.5 * V2 #Maximum value of secondary voltage (in volts)
Im = Vm / RL #Maximum value of load current (in Ampere)
Pm = Im**2 * RL #Maximum value of load power (in watt)
Vdc = 0.318 * Vm #Average value of load power (in watt)
Idc = Vdc / RL #Average value of load current (in Ampere)
Pdc = Idc**2 * RL #Average value of load power (in watt)
#Result
print "Maximum value of load power is ",round(Pm,1)," W."
print "Average value of load power is ",round(Pdc,1)," W."
```

In [2]:

```
import math
#Variables
Vdc = 30.0 #Average value of voltage (in volts)
RL = 600.0 #Load resistance (in ohm)
Rf = 25.0 #forward resistance (in ohm)
#Calculation
Idc = Vdc / RL #Average value of load current (in Ampere)
Im = round(math.pi * Idc,3) #Maximum value of load current (in Ampere)
Vinmax = Im * (Rf + RL) #Maximum a.c. voltage required at the input (in volts)
#Result
print "Maximum a.c. voltage required at the input is ",Vinmax," V."
```

In [5]:

```
import math
#Variables
V2 = 30.0 #secondary voltage (in volts)
RL = 5.1 #Load resistance (in kilo-ohm)
#Calculation
VS = V2 / 2 #Voltage between center - tap and either end of secondary winding (in volts)
Vm = 2**0.5 * VS #maximum value of voltage (in volts)
Vdc = 0.636 * Vm #dc output voltage (in volts)
Idc = Vdc / RL #dc load current (in milli-Ampere)
#Result
print "The dc output voltage is ",round(Vdc,1)," V.\nThe dc output current is ",round(Idc,3)," mA."
#Slight variation in value of Idc due to less precision used in book
```

In [6]:

```
import math
#Variables
V1 = 230.0 #primary voltage (in volts)
N2byN1 = 1.0/4.0 #Turns ratio
RL = 200 #Load resistance (in ohm)
fin = 50 #Frequency (in hertz)
#Calculation
V2 = V1 * N2byN1 #Secondary voltage (in volts)
Vm = 2**0.5 * V2 #Maximum value of voltage (in volts)
Vdc = 0.636 * Vm #Average value of voltage (in volts)
PIV = Vm #peak inverse voltage (in volts)
fout = 2 * fin #Output frequency (in volts)
#Result
print "The dc output voltage is ",round(Vdc,1)," V.\nPeak inverse Voltage of a diode is ",round(PIV,1)," V.\nOutput frequency is ",fout," HZ."
```

In [7]:

```
import math
#Variables
V1 = 230.0 #primary voltage (in volts)
N2byN1 = 1.0/5.0 #Turns ratio
RL = 100 #Load resistance (in ohm)
#Calculation
V2 = V1 * N2byN1 #Secondary voltage (in volts)
VS = V2 / 2 #Voltage between center - tap and either end of secondary winding (in volts)
Vm = 2**0.5 * VS #Maximum value of voltage (in volts)
Vdc = 2/math.pi * Vm #Averaage value of Voltage (in volts)
PIV = 2 * Vm #Peak inverse voltage (in volts)
n = 0.812 #Efficiency of full wave rectifier
#Result
print "The dc output voltage is ",round(Vdc,1)," V.\nPeak inverse voltage is ",round(PIV)," V.\nRectification efficiency is ",n,"."
```

In [8]:

```
import math
#Variables
VS = 200 #Voltage between center - tap and either end of secondary winding (in volts)
Imax = 700 #Maximum value of current (in milli-Ampere)
Iavg = 250 #Average value of current (in milli-Ampere)
#Calculation
Imax1 = 0.8 * Imax #Maximum value of current for normal operation (in milli-Ampere)
Vm = 2**0.5 * VS #Maximum value of voltage (in volts)
RL = Vm / Imax1 #Load resistance (in kilo-ohm)
Vdc = 2 * Vm / math.pi #Average value of voltage (in volts)
Idc = Vdc / RL #Average value of current (in milli-Ampere)
PIV = 2 * Vm #peak Inverse voltage (in volts)
#Result
print "The value of load resistor is ",round(RL,3), "kilo-ohm.\nThe dc load voltage and current is ",round(Vdc)," V and ",Idc," mA.\nPeak inverse voltage is ",round(PIV,2)," V."
```

In [9]:

```
import math
#Variables
Vs = 150.0 #Voltage (in volts)
Idc = 2.0 #Average value of current (in Ampere)
#Calculation
Vdc = 2.34 * Vs #Average calue of voltage (in volts)
Ipi = 1/0.955 * Idc #Peak current per diode (in Ampere)
Iavg = 2.0/3.0 #Average current per diode (in AMpere)
Pdc = Vdc * Idc #Average power delievered to the load (in watt)
#Result
print "The value of Vdc is ",Vdc," V.\nPeak current through each diode is ",round(Ipi,1)," A.\nAverage current through each diode is",round(Iavg,2)," A.\nAverage power delievered to the load is ",Pdc," W."
#Calculation error in calculating the value of Pdc in book. It's value is 702 but printed value is 701 watt.
```

In [10]:

```
import math
#Case (a):
#Variables
f = 50.0 #Frequency (in Hertz)
g = 0.05 #Ripple factor
RL = 100.0 #Resistance (in ohm)
w = 2 * math.pi * f #Angular frequency (in radians per second)
#Calculation
L = RL / (3 * 2**0.5 * w * g) #Inductance (in Henry)
#Result
print "Value of inductance is ",round(L,1)," H."
#Case (b):
#Variables
f = 400.0 #Frequency (in Hertz)
g = 0.05 #Ripple factor
RL = 100.0 #Resistance (in ohm)
w = 2 * math.pi * f #Angular frequency (in radians per second)
#Calculation
L = RL / (3 * 2**0.5 * w * g) #Inductance (in Henry)
#Result
print "New Value of inductance is ",round(L,3)," H."
```

In [11]:

```
import math
#Variables
Vdc = 30.0 #Average value of voltage (in volts)
RL = 1.0 #Resistance (in kilo-ohm)
gamma = 0.01 #Ripple factor
f = 50 #Frequency (in Hertz)
#Calculation
C = 2890.0 / (gamma * RL) #Capacitance (in nano Farad)
#Result
print "Value of capacitance is ",C * 10**-3," micro-Farad."
```

In [12]:

```
import math
#Variables
Vdc = 12.0 #Average value of voltage (in volts)
Idc = 100.0 #Average value of current (in milli-Ampere)
gamma = 0.01 #Ripple factor
L = 1.0 #Inductance (in Henry)
#Calculation
C = 1.195 / (gamma * L) #Capacitance
#Result
print "Capacitance is ",C," micro-Farad."
```

In [13]:

```
import math
#Variables
Idc = 0.2 #Average value of current (in Ampere)
Vdc = 30.0 #Average value of voltage (in volts)
C1 = C2 = 100.0 #Capacitance (in milli-Farad)
L = 5.0 #Inductance (in Henry)
f = 50.0 #Frequency (in Hertz)
#Calculation
RL = Vdc / Idc #Load resistance (in ohm)
gamma = 5700.0 / (C1 * C2 * RL * L) #Ripple factor
#Result
print "Ripple factor for 50 Hz supply is ",gamma,"."
#Correction to be done in the formula for ripple factor used in the question.
#gamma = 5700 / (c1 * C2 * RL * L) --> right formula.
```