import math
#initialisation of variables
Vs=21.0
Vo=12.0
Av=100.0
#Calculations
vo=(Vs*0.1)/Av#source effect is 10% of the Vs
print(" source effect is %3.3fV " %vo)
vo=(21-20)/100.0
print(" laod effect is %3.3fV " %vo)
LR=(21*10**-3 *100)/12.0
print("line regulation is %3.3fpercentage " %LR)
LR=(10*10**-3*100)/12.0
print(" load effect is %3.3fpercentage " %LR)
RJ=20*math.log((1.0/Av),10)
#Results
print("ripple rejection is %d dB " %RJ)
import math
#initialisation of variables
Vo=12.0
Il=40.0*10**-3
Vs=20.0
Vbe=.7
Vz=0.75*Vo
print("for minimum D1 current select")
Ir2=10.0*10**-3
#Calculations
R2=(Vo-Vz)/Ir2
Ie1=Il+Ir2
print("specification for Q")
Vce1=20
Vs=Vce1
Ic1=50*10**-3
Pd=(Vs-Vo)*Ie1
hfe=50
Ib1=Ie1/hfe
Ic2=5*10**-3
R1=(Vs-(Vo+.7))/(Ic2+Ib1)
Iz=Ie1+Ir2
I4=1*10**-3
R4=(Vz+Vbe)/I4
R3=(Vo-(Vz+Vbe))/I4
#Results
print("The value of R3 is %.2f kohm" %(R3/1000))
import math
#initialisation of variables
I4=1.0*10**-3
Vb2=9.8
#Calculations
print(" for Vo=11V moving contact at top of R5")
Vo=11
R3=(Vo-Vb2)/I4
R=Vb2/I4#R=R4+R5
print(" for Vo=13V moving contact at bottom of R5")
Vo=13
I4=Vo/(R3+R)
R4=Vb2/I4
R5=R-R4
#Results
print("The value of R5 is %.2f kohm" %(R5/1000))
import math
#initialisation of variables
hFE3=50.0
hFE1=20.0
Ie1=200.0*10**-3+10*10**-3
Ic2=1.0*1**-3
Vs=20.0
Vb3=13.4
Vo=12.0
Vbe=0.7
#Calculations
Ib1=Ie1/hFE1
Ib3=Ib1/hFE3
R1=(Vs-Vb3)/(Ic2+Ib3)
print("select I6=.5*10**-3")
I6=.5*10**-3
R6=(Vo+Vbe)/I6
Pd=(Vs-Vo)*Ie1
#Results
print(" peak power dissipated is %.3fnW " %Pd)
import math
#initialisation of variables
Vr1=3.0
Ic2=1.0*10**-3
Ib3=0.21*10**-3
Vbe1=0.7
Vbe3=Vbe1
Vs=20.0
#Calculations
R1=Vr1/(Ic2+Ib3)
Vz2=Vo+Vbe1+Vbe3+Vr1
Ir7=5*10**-3
R2=(Vs-Vz2)/Ir7
#Results
print("The value of R2 is %.2f kohm" %(R2/1000))
import math
#initialisation of variables
Vc5=9.8
Vb2=Vc5
Vce5=3.0
Vbe=0.7
Vo=12.0
#Calculations
Vr9=Vc5-Vce5
Vz2=Vr9+Vbe
Ic5=1.0*10**-3
R8=(Vo-Vc5)/Ic5
Ir9=2*Ic5
R9=Vr9/Ir9
print(" Iz2>>Ib5 and Iz2> Izk for the zener diode ")
Iz2=10*10**-3
R7=(Vo-Vz2)/Iz2
I4=1*10**-3
Vb6=7.5
Vz2=Vb6
print(" when Vo=11V moving contact at top of R5 ")
Vo=11
R3=(Vo-Vb6)/I4
R3=3.3*10**3#use standard value
I4=(Vo-Vb6)/R3
R=Vb6/I4#R=R4+R5
print(" when Vo=13V moving contact at bottom of R5")
Vo=13.0
Vb6=7.5
I4=Vo/(R3+R)
R4=Vb6/I4
R5=R-R4
#Results
print("The value of R5 is %.2f kohm" %(R5/1000))
import math
#initialisation of variables
Isc=100.0*10**-3
Vr10=0.5
Vo=12.0
#Calculations
R10=Vr10/Isc
R10=4.7#use standard value
Il=200.0*10**-3
Vr10=Il*R10
Vr11=Vr10-.5
I11=1.0*10**-3
R11=Vr11/I11
R12=(Vo+Vr10-Vr11)/I11
#Results
print("The value of R12 is %.2f kohm" %(R12/1000))
import math
#initialisation of variables
Vo=12.0
hFE1=20.0
hFE2=50.0
Il=250.0*10**-3
Vz=0.75*Vo
Vz=9.1#use standard value for 1N757 diode
Iz1=10.0*10**-3
#Calculations
R1=(Vo-Vz)/Iz1
I3=1.0*10**-3
print(" when V0=12V(moving contact at top of R5)")
R3=(Vo-Vz)/I3
R=Vz/I3
print(" when Vo=15V moving contact at bottom of R5")
Vo=15
I3=Vo/(R+R3)
R4=Vz/I3
R5=R-R4
Ir6=.5*10**-3
R6=Vo/Ir6
print(" op-amp output current")
Ib2=Il/(hFE1*hFE2)
#Results
print("The value of Ib2 is %.2f mA" %(Ib2*10**3))
import math
#initialisation of variables
I2=1.0*10**-3
Vr2=7.15
Vref=Vr2
Vo=10.0
Pdmax=1000.0*10**-3
#Calculations
R2=Vref/I2
R2=6.8*10**3#use standard value and recalculate the I2
I2=Vref/R2
R1=(Vo-Vref)/I2
Vs=Vo+5#for satisfactory operation of series pass transistor
Iint=25*10**-3#internal circuit current
Pi=Vs*Iint
print("maximum power dissipated in series pass transistor")
Pd=Pdmax-Pi
print("maximum load current is ")
Il=Pd/(Vs-Vo)
#Results
print("The value of Il is %.2f mA" %(Il*10**3))
import math
#initialisation of variables
I1=1.0*10**-3
Vref=1.25
Vo=6.0
Vs=15.0
Il=200.0*10**-3
#Calculations
R1=Vref/I1
R2=(Vo-Vref)/I1
Pd=(Vs-Vo)*Il
#Results
print("regulated power dissipation is %.2f W " %Pd)
import math
#initialisation of variables
Vo=10.0
Io=1.0
Vce=7.0
Vf=1.0
#Calculations
Po=Vo*Io
print(" linear regulator")
Pi=Po+(Vce*Io)
n=(Po*100.0)/Pi#efficiency
print(" switching regulator")
Vce=1
Pi=Po+Io*(Vce+Vf)
n=(Po*100.0)/Pi#efficiency
#Results
print("The value of n is %.2f " %(n))
import math
#initialisation of variables
f=50.0*10**3
Vo=12.0
Vf=0.7
Vi=30.0
Vsat=1.0
Io=500.0*10**-3
Vr=100.0*10**-3
#Calculations
T=1.0/f
t=(Vo+Vf)/(Vi-Vsat-Vo)
toff=T/1.75
ton=T-toff
Ip=2*Io
L1=((Vi-Vsat-Vo)*ton)/Ip
C1=Ip/(8.0*f*Vr)
#Results
print("The value of C1 is %.2f pF" %(C1*10**6))
import math
#initialisation of variables
print(" an MC34063 controller is for step down transformer")
Ib=-400.0*10**-3
I1=1.0*10**-3
Vref=1.25
V0=12.0
Ip=1.0
#Calculations
ton=8.6*10**-6
R1=Vref/I1
R1=1.2*10**3#use standard value
I1=Vref/R1
R2=(Vo-Vref)/I1
Rsc=.33/Ip
Ct=4.8*10**-5 *ton
#Results
print("The value of Ct is %.2f pF" %(Ct*10**6))