In [1]:

```
import math
#Variables
RL = 100.0 #Resistance (in ohm)
Vm = 300.0 #Maximum voltage (in volts)
P1 = 25.0 #Load power1 (in watt)
P2 = 80.0 #Load power2 (in watt)
#Calculation
Vdc = Vm / (2 * math.pi) #dc voltage (in volts)
#When power is 25 watt
cosinealpha = (P1 * RL / Vdc**2)**0.5 -1 #cos of alpha
alpha = math.acos(cosinealpha) #Value of alpha (in radians)
#When power is 80 watt
cosinealpha1 = (P2 * RL / Vdc**2)**0.5 -1 #cos of alpha
alpha1 = math.acos(cosinealpha1) #Value of alpha (in radians)
#Result
print "Angular firing control when load power P = 25 W is ",round(alpha * 180.0 / math.pi,2)," degree.\nAngular firing control when load power P = 80 W is ",round(alpha1 * 180.0 / math.pi,2)," degree."
#Calculation difference in value of cosinealpha from book due to higher precision.
```

In [2]:

```
import math
#Variables
Vm = 200.0 #maximum voltage (in volts)
RL = 1.0 #Resistance (in kilo-ohm)
#Calculation
#When alpha = 0 degree
Vdc = 0.318 * Vm #dc voltage (in volts)
Idc = Vdc / RL #dc Current (in milli-Ampere)
P = Vdc * Idc #Power (in milli-watt)
#When alpha = 45 degree
Vdc1 = 0.27 * Vm #dc voltage1 (in volts)
Idc1 = Vdc1 / RL #dc current1 (in milli-Ampere)
P1 = Vdc1 * Idc1 #Power1 (in milli-watt)
#When alpha = 90 degree
Vdc2 = 0.159 * Vm #dc voltage2 (in volts)
Idc2 = Vdc2 / RL #dc current2 (in milli-Ampere)
P2 = Vdc2 * Idc2 #Power2 (in milli-watt)
#When alpha = 135 degree
Vdc3 = 0.0466 * Vm #dc voltage3 (in volts)
Idc3 = Vdc3 / RL #dc current3 (in milli-Ampere)
P3 = Vdc3 * Idc3 #Power3 (in milli-watt)
#Result
print "Power delivered when alpha = 0 degree is ",round(P)," mW.\nPower delivered when alpha = 45 degree is ",P1," mW.\nPower delivered when alpha = 90 degree is ",round(P2)," mW.\nPower delivered when alpha = 135 degree is ",round(P3,2)," mW."
```

In [3]:

```
import math
#Variables
Vrms = 220.0 #rms voltage (in volts)
alpha = 60.0 #Firing angle (in degree)
#Calculation
alpharad = alpha * math.pi/180.0 #Firing angle (in radians)
Vm = 2**0.5 * Vrms #Maximum or Peak voltage (in volts)
Vdc = Vm /(2 * math.pi)*(1 + math.cos(alpharad)) #dc output voltage (in volts)
#Result
print "The d.c. output voltage is ",round(Vdc,2)," V."
#Slight variation in answer due to higher precision
```

In [4]:

```
import math
#Variables
Idc = 0.5 #dc current (in Ampere)
Vrms = 100.0 #Rms voltage (in volts)
alpha = 45.0 #Firing angle (in degree)
Idc = 0.5 #dc current (in Ampere)
#Calculation
alpharad = alpha * math.pi / 180.0 #Firing angle (in radians)
Vm = 2**0.5 * Vrms #Peak voltage (in volts)
Vdc = Vm / (2 * math.pi)*(1 + math.cos(alpharad)) #Average voltage (in volts)
RL = Vdc / Idc #Load resistance (in ohm)
#Result
print "The value of resistance to limit the average current to 0.5 A is ",round(RL,2)," ohm."
#Slight variation in answer due to higher precision
```

In [5]:

```
import math
#Variables
TON = 30.0 #Chopper ON time (in milli-second)
TOFF = 10.0 #Chopper OFF time (in milli-second)
#Calculation
T = TON + TOFF #Total time (in milli-second)
cdc = TON / T #Chopper duty cycle
f = 1 / T #Chopping frequency (in Hertz)
#Result
print "Chopper duty cycle is ",cdc,".\nChopping frequency is ",f * 10**3," Hz."
#Correction to be done in book , the units mentioned are milli-Ampere but in the calculation it used micro-Ampere.
```

In [6]:

```
import math
#Variables
TON = 30.0 #Chopper ON time (in milli-second)
TOFF = 10.0 #Chopper OFF time (in milli-second)
Vdc = 200.0 #dc voltage (in volts)
#Calculation
T = TON + TOFF #Total time (in milli-second)
cdc = TON / T #Chopper duty cycle
VL = Vdc * cdc #dc output voltage (in volts)
#Result
print "Average valuye of dc voltage is ",VL," V."
```