#Determine the (a)ripple voltage (b)voltage drop (c)Average output volatge (d)ripple factor
from math import sqrt
I1 = 5*10**-3 # A
C2 = 0.05*10**-6 # F
C1 = 0.01*10**-6 # F
Vs = 100 # kV
f = 50 # Hz
# (a) Ripple voltage
print"Part (a)"
delV = I1/(C2*f)
print"Ripple Voltage = %d V"%delV
# (b) Voltage drop
print"\nPart (b)"
Vd = I1/f*((1/C1)+(1/(2*C2)))
print"Voltage drop = %.1f V"%Vd
# (c) Average output voltage
print"\nPart (c)"
Vav = 2*Vs*sqrt(2)-Vd*10**-3
print"Average output voltage = %.1f kV"%round(Vav,1)
# (d) Ripple factor
print"\nPart (d)"
RF = Vd*10**-3/(2*Vs*sqrt(2))
print"Ripple Factor in percentage = %.2f "%round(RF*100,2)
#Determine the (a)ripple voltage (b)voltage drop (c)Average output volatge (d)ripple factor
from math import sqrt
I1 = 5*10**-3 # A
C3 = 0.10*10**-6 # F
C2 = 0.05*10**-6 # F
C1 = 0.01*10**-6 # F
Vs = 100 # kV
f = 50 # Hz
# (a) Ripple voltage
print"\nPart (a)"
delV = I1/f*((2/C1)+(1/C3))
print"Ripple Voltage = %d kV"%(delV*10**-3)
# (b) Voltage drop
print"\nPart (b)"
Vd = I1/f*((1/C2)+(1/C1)+(1/(2*C3)))
print"Voltage drop = %.1f kV"%round(Vd*10**-3,1)
# (c) Average output voltage
print"\nPart (c)"
Vav = 3*Vs*sqrt(2)-Vd*10**-3
print"Average output voltage = %.2f kV"%round(Vav,2)
# (d) Ripple factor
print"\nPart (d)"
RF = Vd*10**-3/(3*Vs*sqrt(2))
print"Ripple Factor in percentage = %.2f "%round(RF*100,2)
# Answers may vary due to round off error
#Determine the (a)ripple voltage (b)voltage drop (c)Average output volatge (d)ripple factor (e)optimum number of stages
from math import sqrt
I1 = 5*10**-3 # A
C = 0.15*10**-6 # F
Vs = 200. # kV
f = 50 # Hz
n = 12
# (a) Ripple voltage
print"\nPart (a)"
delV = I1*n*(n+1)/(f*C*2)
print"Ripple Voltage = %d kV"%(delV*10**-3)
# (b) Voltage drop
print"\nPart (b)"
a = I1/(f*C)
Vd = a*((2./3*n**3)+(n**2/2)-(n/6)+(n*(n+1)/4))
print"Voltage drop = %.1f kV"%(Vd*10**-3)
# (c) Average output voltage
print"\nPart (c)"
Vav = 2*n*Vs*sqrt(2)-Vd*10**-3
print"Average output voltage = %.1f kV"%Vav
# (d) Ripple factor
print"\nPart (d)"
RF = Vd*10**-3/(2*n*Vs*sqrt(2))
print"Ripple Factor in percentage = %.1f"%(RF*100)
# (e) Optimum number of stages
print"\nPart (e)"
nopt = sqrt(Vs*sqrt(2)*10**3.*f*C/I1)
print"Optimum number of stages = %d stages"%nopt
# Answers may vary due to round off error
#Determine the input voltage and power
from math import pi
Vc = 500*10**3 # V
A = 4 # A
Xl = 8./100. # in percentage
kV = 250.
Xc = Vc/A # Reactance of the cable
XL = Xl*(kV**2/100)*10**3 # Leakage reactance of the transformer
Radd = Xc-XL # Additional series reactance
Ind = Radd/(2*pi*XL) # Inductance of required series inductor
R = 3.5/100.*(kV**2/100)*10**3 # Total circuit resistance
Imax = 100./250. # maximum current that can be supplied by the transformer
Vex = Imax*R # Exciting voltage of transformer secondary
Vin = Vex*220/kV # Input voltage of transformer primary
P = Vin*100./220. # Input power of the transformer
print"Reactance of the cable = %d k ohm"%(Xc*10**-3)
print"Leakage reactance of the transformer = %d k ohm"%(XL*10**-3)
print"Additional series reactance = %d k ohm"%(Radd*10**-3)
print"Inductance of required series inductor = %.1f H"%(Ind*10**3)
print"Total circuit resistance = %.2f k ohm"%(R*10**-3)
print"maximum current that can be supplied by the transformer = %.1f A"%(Imax)
print"Exciting voltage of transformer secondary = %.2f kV"%(Vex*10**-3)
print"Input voltage of transformer primary = %.1f V"%(Vin*10**-3)
print"Input power of the transformer = %.1f kW"%(P*10**-3)
# Answers may vary due to round off error
#Determine the charging current and potential difference
ps = 0.5*10**-6 # C/m**2
u = 10 # m/s
w = 0.1 # m
I = ps*u*w
Rl = 10**14 # ohm
V = I*Rl*10**-6
print"Charging current= %.1f micro A"%(I*10**6)
print"Potential difference = %d MV"%V
# Answers may vary due to round off error
#Determine the wave generated
from math import sqrt
# With refrence to table 16.1
C1 = 0.125*10**-6 # F
C2 = 1*10**-9 # F
R1 = 360. # ohm
R2 = 544. # ohm
V0 = 100. # kV
theta = sqrt(C1*C2*R1*R2)
neta = 1./(1+(1+R1/R2)*C2/C1)
alpha = R2*C1/(2*theta*neta)
print"Theta = %.2f micro S"%(theta*10**6)
print"Neta = %.2f"%neta
print"Alpha = %.2f "%alpha
# Coresponding to alpha the following can be deduced from Fig 16.12
T2 = 10.1*theta*10**6
T1 = T2/45
imp = T1/T2 # generated lighting impulse
# From equations 16.41 and 16.42
a1 = (alpha-sqrt(alpha**2-1))*10**-6/(theta)
a2 = (alpha+sqrt(alpha**2-1))*10**-6/theta
print"\nT1 = %.2f microS"%T1
print"T2 = %.2f microS"%T2
print"Generated lighting impulse = %f wave"%imp
print"alpha1 = %.3f microS"%a1
print"alpha2 = %.2f microS"%a2
# According to equation 16.40
et = neta*(alpha*V0)/sqrt(alpha**2-1)
print"e(t) = %.3f * (e**%.3ft - f**%.3ft)"%(et,round(-a1,3),round(-a2,2)) # Equation of the wave form generated by the impulese
#Answers may vary due to round off error
#Determine the wave generated
from math import sqrt
C1 = 0.125*10**-6 # F
C2 = 1*10**-9 # F
R1 = 360. # ohm
R2 = 544. # ohm
V0 = 100. # kV
theta = sqrt(C1*C2*R1*R2)
neta = 1/(1+R1/R2+C2/C1)
alpha = R2*C1/(2*theta*neta)
print"Theta = %.2f micro S"%(theta*10**6)
print"Neta = %.2f"%neta
print"Alpha = %.2f"%alpha
# Coresponding to alpha the following can be deduced from Fig 16.12
T2 = 16.25*theta*10**6
T1 = T2/120.
# From equations 16.41 and 16.42
a1 = (alpha-sqrt(alpha**2-1))*10**-6/(theta)
a2 = (alpha+sqrt(alpha**2-1))*10**-6/theta
print"T1 = %.2f microS"%T1 # Answer given in the text is wrong
print"T2 = %.2f microS"%T2
print"alpha1 = %.4f microS"%a1
print"alpha2 = %.2f microS"%a2
# According to equation 16.40
et = neta*(alpha*V0)/sqrt(alpha**2-1)
print"e(t) = %.3f * (e**%.3ft - f**%.3ft)"%(et,round(-a1,4),round(-a2,2)) # Equation of the wave form generated by the impulese
#Answers may vary due to round off error
#Determine the circuit efficiency
from math import sqrt
C1 = 0.125*10**-6 # F
C2 = 1*10**-9 # F
T2 = 2500.
T1 = 250.
# Bsaed on Figure 16.12
T2T1 = T2/T1
a = 4. # alpha
theta = T2/6.
# From table 16.1
X = (1/a**2)*(1+C2/C1)
R1 = (a*theta*10**-6/C2)*(1-sqrt(1-X))
R2 = (a*theta*10**-6/(C1+C2))*(1+sqrt(1-X))
neta = 1/(1+(1+R1/R2)*C2/C1)
print"Theta = %.2f micro S"%theta
print"X = %.4f "%X
print"R1 = %.1f k Ohm"%(R1*10**-3)
print"R2 = %.1f k Ohm"%(R2*10**-3)
print"neta = %.3f "%round(neta,3)
# Answers may vary due to round off error
#Determine the maximum output voltage and energy rating
from math import sqrt
n = 8.
C1 = 0.16/n # micro F
C2 = 0.001 # micro F
T2 = 50.
T1 = 1.2
# beased on figure 16.12
a = 6.4 # alpha
theta = T2/9.5
X = (1./a**2)*(1.+C2/C1)
R1 = (a*theta*10**-6/C2)*(1.-sqrt(1-X))
R2 = (a*theta*10**-6/(C1+C2))*(1+sqrt(1-X))
R1n = R1/n
R2n = R2/n
V0 = n*120
neta = 1/(1+(1+R1/R2)*C2/C1)
V = neta*V0
E = 1./2.*C1*V0**2
print"Theta = %.2f micro S"%theta
print"X = %.3f "%X
print"V0 = %.2f "%V0
print"R1 = %.2f Ohm"%(R1*10**6)
print"R2 = %.2f Ohm"%(R2*10**6)
print"R1/n = %.2f Ohm"%(R1n*10**6)
print"R2/n = %.2f Ohm"%(R2n*10**6)
print"neta = %.2f "%neta
print"Maximum output voltage = %.2f kV"%V
print"Energy rating = %.2f kJ"%(E/1000)
# Answers greatly vary due to round off error
#Determine the from and tail times
from math import sqrt
n = 12.
C1 = 0.125*10**-6/n # micro F
C2 = 0.001*10**-6 # micro F
R1 = 70.*n # ohm
R2 = 400.*n # ohm
# beased on figure 16.15
theta = sqrt(C1*C2*R1*R2)
neta = 1./(1+R1/R2+C2/C1)
a = R2*C1/(2*theta*neta) # alpha
T2 = 7.*theta*10**6
T1 = T2/25
print"R1 = %.2f Ohm"%R1
print"R2 = %.2f Ohm"%R2
print"Theta = %.2f microS"%(theta*10**6)
print"Neta = %.2f"%neta
print"Alpha = %.2f "%a
print"T1 = %.2f microS"%round(T1,2)
print"T2 = %.2f microS"%round(T2,2)
# Answers greatly vary due to round off error
#Determine the equation generated by impulse
from math import sqrt
w = 0.02*10**6 # s**-1 obtained by solving eq 16.47 iteratively
R = sqrt(4-(sqrt(8*8*4)*0.02)**2) # solved the simplified equation
L = 8*10**-6
V = 25*10**3
# In equation 16.46
y = R/(2.*L)
# Deriving the equation
a = V/(w*L)
print"R = %.2f ohm"%R
print"y = %.2e s**-1"%y
print"I(t) = %.2f* exp(%.2et) * sin(%.2ft) A"%(a/10000,round(-y,1),w)
# Answers may vary due to round off error