import math
#Given data
Idc= 300 # in mA
C= 200 # in µF
Vmax= 24 # in V
Vrms= 2.4*Idc/C #in V
Vr_peak= math.sqrt(3)*Vrms # in V
Vdc= Vmax-Vr_peak # in V
print "The minimum input voltage = %0.2f V" %Vdc
#Given data
VR= 12 # in V
IL= 0.5 # in A
RL= 25 # in Ω
# Resistanc required,
R= VR/IL # in Ω
VL= IL*RL # in V
Vout= VR+VL #output voltage in V
Vin= Vout+2 # input voltage in V
print "The input voltage = %0.1f V" %Vin
#Given data
R1= 240 # in Ω
R2= 1.2*10**3 # in Ω
# Regulated output voltage in the circuit,
Vout= 1.25*(1+R2/R1) # in V
print "The regulated output voltage = %0.1f V" %Vout
#Given data
V_REG= 15 # in V
I_Q= 10*10**-3 # in A
R1= 40 # in Ω
# When potentiometer R2=0 Ω (minimum)
R2= 0 # in Ω
Vout= (1+R2/R1)*V_REG+I_Q*R2
print "The minimum output voltage = %0.f V" %Vout
# When potentiometer R2=200 Ω (maximum)
R2= 200 # in Ω
Vout= (1+R2/R1)*V_REG+I_Q*R2
print "The maximum output voltage = %0.f V" %Vout
#Given data
V_REF= 1.25 # in V
R1= 2.5*10**3 # in Ω
R2= 1*10**3 # in Ω
I= V_REF/R2 # in A
# The output voltage,
Vout= I*(R1+R2) # in V
print "The regulated output voltage = %0.3f V" %Vout
#Given data
V_REF= 1.25 # in V
R1= 3*10**3 # in Ω
R2= 1*10**3 # in Ω
Vin= 20 # in V
Vout= V_REF*(R1+R2)/R2 # output voltage in volts
# Duty cycle,
D= Vout/Vin*100 # in %
print "The duty cycle = %0.f %%" %D