import math
from __future__ import division
#initialisation of variables
V2=12 #load
D=0.8 #duty cycle
P0=20 #average power
#CALCULATIONS
V1=V2/D #V
I1=P0/V1
#RESULTS
print"The value of I1=",round(I1,3),"A";
import math
from __future__ import division
#initialisation of variables
Rl=7 #Load Ω
#CALCULATIONS
fs=30*10**3 #kHz.
Lc=50*10**-6 #Inductor H
D=1-((2*fs*Lc)/Rl)
#RESULTS
print"The value of D=",round(D,3);
import math
from __future__ import division
#initialisation of variables
V2=5 #V
V1=12 #V
Rl=5 #Ω
#CALCULATIONS
D=V2/V1
p0=V2**2/Rl
#RESULTS
print"The value of D=",round(D,3);
print"The value of p0=",round(p0,3);
import math
from __future__ import division
#initialisation of variables
D=0.6 #Duty cycle
V1=24 #V
Rl=7
#CALCULATIONS
fs=30*10**3
L=50*10**-6
V2=D*V1
Imax=V2/Rl+((V1-V2)*D)/(2*fs*L) #maximum values of the inductor current
Imin=V2/Rl-((V1-V2)*D)/(2*fs*L) #minimum values of the inductor current
#RESULTS
print"The value of Imax=",round(Imax,3),"A";
print"The value of Imin=",round(Imin,3),"A";
import math
from __future__ import division
#initialisation of variables
V1=12
D=0.6
P0=60 #w Supplying power
#CALCULATIONS
V2=V1/(1-D) #output voltage
Rl=V2**2/P0 #load resistance
I2=V2/Rl #load current
#RESULTS
print"The value of V2=",round(V2,3),"V";
print"The value of Rl=",round(Rl,3),"ohm";
print"The value of I2=",round(I2,3),"A";