import math
#initialisation of variables
Vs=25.0
Vtm=1.7
Rl=25.0
Ih=5*10**-3
#Calculations
Vspk=1.414*Vs
Ilpk=(Vs-Vtm)/Rl
print(" for half wave rectifier sinusodial waveform")
Ilrms=.5*Ilpk
es=Vtm+(Ih*Rl)
#Results
print(" switch-off voltage =%.2f v" %es)
import math
#initialisation of variables
Vs=30.0
Vd1=.7
Vg=.8
Ig=200*10**-6
#Calculations
Vspk=1.414*Vs
print(" at 5 degree")
es=Vspk*.087 # sin5=.087
print(" at 90 degree")
es=Vspk
Vt=Vd1+Vg
print(" to trigger at es=3.7V the R2 moving contact is at the top")
es=3.7
Vr1=es-Vt
I1=1*10**-3
R1=Vr1/I1
R=Vt/I1 #R=R2+R3
es=42.4
Vr3=Vt
I1=es/(R+R1)
R3=Vt/I1
R2=R-R3
#Results
print(" To trigger at es =42.4 the R2 moving contact at the bottom =%.2f" %R2)
import math
#initialisation of variables
R1=2.2*10**3
R2=1.5*10**3
R3=120.0
Vt=1.5
#Calculations
Vak1=Vt*((R1+R2+R3)/(R3+.5*R2))
Vak2=Vt*((R1+R2+R3)/R3)
#Results
print(" with R2 contact at center = %.2f" %Vak1)
print(" with R2 contact at zero = %.2f" %Vak2)
import math
#initialisation of variables
Vs=5.0
Ilmax=300*10**-3
Vl=7.0
Vg=0.8
#Calculations
Vz=Vl-Vg
print(" for D1, select a 1N753 with Vz=6.2")
Izmin=1*10**-3
R1=Vg/Izmin
#Results
print("The value of R1 is %d kohm " %R1)
import math
#initialisation of variables
R1=25*10**3
R2=2.7*10**3
C1=3*10**-6
Vg=0.8
Vd1=8.0
Vs=115.0
f=60.0
#Calculations
Vc1=Vd1+Vg
#assume the average charging voltage is
Vac=1.414*Vs
E=.636*Vac
#average charging
Ic=E/(R1+R2)
#charging time
t=(C1*Vc1)/Ic
T=1/f
q=(t*360)/T
a=180-q
#Results
print("Conduction angle =%.2f degrees" %a)
import math
#initialisation of variables
Vs=10.0
Vf=1.7
Is=500*10**-6
Ih=1.5*10**-3
E=30.0
#Calculations
R=27*10**3
C=0.5*10**-6
R1max=(E-Vs)/Is
R1min=(E-Vf)/Ih
t=C*R*math.log((E-Vf)/(E-Vs))
#Results
print("Capacitor charging time is %3.4f s" %t)
import math
#initialisation of variables
Rbb=4.0*10**3
Pd25=360.0*10**-3
D=2.4*10**-3
T2=100.0
#Calculations
Pd=Pd25-D*(T2-25)
Vb1b1=math.sqrt(Rbb*Pd)
#Results
print("Maximum Vb1b1 that should be used at a temp 100 is %3.1fV " %Vb1b1)
import math
#initialisation of variables
Vb1b1=25
nmax=0.86
nmin=0.74
Vd=0.7
#Calculations
Vpmax=Vd+(nmax*Vb1b1)
Vpmin=Vd+(nmin*Vb1b1)
#Results
print("Maximum Vpmax that should be is %3.1fV " %Vpmax)
print("Minimum Vpmin that should be is %3.1fV " %Vpmin)
import math
#initialisation of variables
Ip=.6*10**-6
Iv=2*10**-3
Veb1=2.5
Vpmin=19.2
Vpmax=22.2
Vbb=25.0
C=1*10**-6
R=18*10**3
Vp=20.0
#Calculations
Vpmin=(Vbb-Vpmax)/Ip
Remax=(Vbb-Veb1)/Iv
t=C*R*math.log((Vbb-Veb1)/(Vbb-Vp))
f=1.0/t
#Results
print("The value of f is %.2f " %f)