import math
# GIVEN DATA
V_RL_L = 23.*10**3 ; # line to line voltage in volts
z_t = 2.48+6.57j ; # Total impedance in ohm/phase
p = 9.*10**6 ; # load in watts
pf = 0.85 ; # lagging power factor
# CALCULATIONS
# METHOD I : USING COMPLEX ALGEBRA
V_RL_N = (V_RL_L)/math.sqrt(3) ; # line-to-neutral reference voltage in V
I = (p/(math.sqrt(3)*V_RL_L*pf))*( pf - (math.sin(math.acos((pf))))*1j) ; # Line current in amperes
IZ = I*z_t ;
V_SL_N = V_RL_N + IZ # Line to neutral voltage at sending end in volts
V_SL_L = math.sqrt(3)*V_SL_N ; # Line to line voltage at sending end in volts
V_SL_N_degrees = 4.4
# DISPLAY RESULTS
print " a) Line-to-neutral voltage at sending end , V_SL_N = %.f<%.1f V "\
%(abs(V_SL_N),V_SL_N_degrees) ;
print " i.e Line-to-neutral voltage at sending end , V_SL_N = %.f V "%abs(V_SL_N)
print " Line-to-line voltage at sending end , V_SL_L = %.f<%.1f V "%(abs(V_SL_L),V_SL_N_degrees)
print " i.e Line-to-line voltage at sending end , V_SL_L = %.f V "%(abs(V_SL_L))
print " b) load angle , δ = %.1f degree "%V_SL_N_degrees
# CALCULATIONS
# METHOD II : USING THE CURRENT AS REFERENCE PHASOR
theta_R = math.degrees(math.acos((pf))) ;
V1 = V_RL_N*(math.cos(math.radians(theta_R))) + abs(I)*(z_t.real) ; # unit is volts
V2 = V_RL_N*(math.sin(math.radians(theta_R))) + abs(I)*(z_t.imag) ; # unit is volts
V_SL_N2 = math.sqrt( (V1**2) + (V2**2) ) ; # Line to neutral voltage at sending end in volts/phase
V_SL_L2 = math.sqrt(3) * V_SL_N2 ; # Line to line voltage at sending end in volts
theta_s = math.degrees(math.atan((V2/V1))) ;
delta = theta_s - theta_R ;
# DISPLAY RESULTS
print ("METHOD II : USING THE CURRENT AS REFERENCE PHASOR");
print " a) Line-to-neutral voltage at sending end , V_SL_N = %.f V "%V_SL_N2
print " Line-to-line voltage at sending end , V_SL_L = %.f V "%V_SL_L2 ;
print " b) load angle , δ = %.1f degree "%delta ;
# CALCULATIONS
# METHOD III : USING THE RECEIVING-END VOLTAGE AS REFERENCE PHASOR
# for case (a)
V_SL_N3 = math.sqrt( (V_RL_N + abs(I) * z_t.real * math.cos(math.radians(theta_R)) + abs(I) * (z_t.imag) * \
math.sin(math.radians(theta_R)))**2 + (abs(I)*(z_t.imag) * math.cos(math.radians(theta_R)) - \
abs(I) * z_t.real * math.sin(math.radians(theta_R)))**2) ;
V_SL_L3 = math.sqrt(3)*V_SL_N3 ;
# for case (b)
delta_3 = math.degrees(math.atan( (abs(I)*z_t.imag * math.cos(math.radians(theta_R)) - abs(I) * z_t.real * math.sin(math.radians(theta_R)))/(V_RL_N + abs(I) * z_t.real * math.cos(math.radians(theta_R)) + abs(I) * z_t.imag * math.sin(math.radians(theta_R))))) ;
# DISPLAY RESULTS
print ("METHOD III : USING THE RECEIVING END VOLTAGE AS REFERENCE PHASOR") ;
print " a) Line-to-neutral voltage at sending end , V_SL_N = %.f V "%V_SL_N3
print " Line-to-line voltage at sending end , V_SL_L = %.f V "%V_SL_L3
print " b) load angle , δ = %.1f degree "%delta_3
print "" ;
# CALCULATIONS
# METHOD IV : USING POWER RELATIONSHIPS
P_4 = 9 ; # load in MW (Given)
P_loss = 3 * (abs(I))**2 * z_t.real * 10**-6 ; # Power loss in line in MW
P_T = P_4 + P_loss ; # Total input power to line in MW
Q_loss = 3 * (abs(I))**2 * z_t.imag * 10**-6 ; # Var loss of line in Mvar lagging
Q_T = P_4*math.sin(math.radians(theta_R))/math.cos(math.radians(theta_R) ) + Q_loss ; # Total megavar input to line in Mvar lagging
S_T = math.sqrt( (P_T**2)+(Q_T**2) ) ; # Total megavoltampere input to line
# for case (a)
V_SL_L4 = S_T*10**6/(math.sqrt(3) * abs(I)) ; # line to line voltage in volts
V_SL_N4 = V_SL_L4/math.sqrt(3) ; # Line to line neutral in volts
# for case (b)
theta_S4 = math.acos(math.radians(P_T/S_T)) ; # Lagging
delta_4 = theta_s - theta_R ;
# DISPLAY RESULTS
print ("METHOD IV : USING POWER RELATIONSHIPS");
print " a) Line-to-neutral voltage at sending end , V_SL_N = %.f V "%V_SL_N4
print " a) Line-to-line voltage at sending end , V_SL_L = %.f V "%V_SL_L4
print " b) load angle , δ = %.1f degree "%delta_4
print "";
# CALCULATIONS
# METHOD V : Treating 3-Φ line as 1-Φ line having having V_S and V_R represent line-to-line voltages not line-to-neutral voltages
# for case (a)
I_line = (p/2)/(V_RL_L * pf) ; # Power delivered is 4.5 MW
R_loop = 2*z_t.real ;
X_loop = 2*z_t.imag ;
V_SL_L5 = math.sqrt( (V_RL_L * math.cos(math.radians(theta_R)) + I_line*R_loop)**2 + \
(V_RL_L * math.sin(math.radians(theta_R)) + I_line * X_loop)**2) ; # line to line voltage in V
V_SL_N5 = V_SL_L5/math.sqrt(3) ; # line to neutral voltage in V
# for case (b)
theta_S5 = math.degrees(math.atan( (V_RL_L * math.sin(math.radians(theta_R)) + I_line * X_loop)/ \
(V_RL_L * math.cos(math.radians(theta_R)) + I_line*R_loop))) ;
delta_5 = (theta_S5) - theta_R ;
# DISPLAY RESULTS
print ("METHOD V : TREATING 3-Φ LINE AS 1-Φ LINE") ;
print " a) Line to neutral voltage at sending end , V_SL_N = %.f V "%V_SL_N5
print " a) Line to line voltage at sending end , V_SL_L = %.f V "%V_SL_L5
print " b) load angle , δ = %.1f degree "%delta_5
print "" ;
print " NOTE : ERROR : Change in answer because root3 = 1.73 is considered in Textbook " ;
print " But here math.sqrt3 = 1.7320508 is considered " ;
import math
# GIVEN DATA
# for case (a)
V_S = 14803. ; # sending end phase voltage at no load in volts . From exa 4.1
V_R = 13279.056 ; # receiving end phase voltage at full load in volts . From exa 4.1
# for case (b)
I_R = 265.78785 ; # Line current in amperes . From exa 4.1
z_t = 2.48+6.57*1j ; # Total impedance in ohm/phase
pf = 0.85 ; # power factor
theta_R = math.degrees(math.acos((pf))) ;
# CALCULATIONS
# for case (a)
V_reg1 = ( (V_S - V_R)/V_R )*100 ; # percentage voltage regulation umath.sing equ 4.29
# for case (b)
V_reg2 = (I_R * ( z_t.real * math.cos(math.radians(theta_R)) + z_t.imag * \
math.sin(math.radians(theta_R)) )/ V_R)*100 ; # percentage voltage regulation umath.sing equ 4.31
# DISPLAY RESULTS
print ("EXAMPLE : 4.2 : SOLUTION :-") ;
print " a) Percentage of voltage regulation using equ 4.29 = %.1f "%V_reg1
print " b) Percentage of voltage regulation using equ 4.31 = %.1f "%V_reg2 ;
print " NOTE : ERROR : The question is with respect to values given in Exa 4.1 not 4.5 " ;
import math
from numpy import exp
# GIVEN DATA
Z_xy = 0.09 + 1j*0.3 ; # Mutual impedance between two parallel feeders in Ω/mi per phase
Z_xx = 0.604*exp(1j*50.4*math.pi/180) ; # Self impedance of feeders in Ω/mi per phase
Z_yy = 0.567*exp(1j*52.9*math.pi/180) ; # Self impedance of feeders in Ω/mi per phase
# SOLUTION
Z_2 = Z_xx - Z_xy ; # mutual impedance between feeders
Z_4 = Z_yy - Z_xy ; # mutual impedance between feeders
# DISPLAY RESULTS
print ("EXAMPLE : 4.3 : SOLUTION :-") ;
print " Mutual impedance at node 2 , Z_2 = %.3f + j%.3f Ω"%(Z_2.real,Z_2.imag) ;
print " Mutual impedance at node 4 , Z_4 = %.3f + j%.3f Ω"%(Z_4.real,Z_4.imag) ;
import math
from numpy import exp,array,matrix
# GIVEN DATA
V = 138.*10**3 ; # transmission line voltage in V
P = 49.*10**6 ; # load power in Watts
pf = 0.85 ; # lagging power factor
Z = 95. * exp(1j*78*math.pi/180) ; # line consmath.tants in Ω
Y = 0.001 * exp(1j*90*math.pi/180) ; # line consmath.tants in siemens
# CALCULATIONS
V_RL_N = V/math.sqrt(3) ;
theta_R = math.acos(pf) ;
I_R = P/(math.sqrt(3)*V*pf)*( math.cos((theta_R)) - 1j*math.sin((theta_R)) ) ; # receiving end current in ampere
# for case (a)
# A,B,C,D consmath.tants for nominal-T circuit representation
A = 1 + (1./2)*Y*Z ;
B = Z + (1./4)*Y*Z**2 ;
C = Y ;
D = A ;
# for case (b)
P = (matrix([[A, B],[C, D]]) * matrix([[V_RL_N] ,[I_R]])) ;
V_SL_N = P[0,0] ; # Line-to-neutral Sending end voltage in V
V_SL_L = math.sqrt(3) * abs(V_SL_N) * exp(1j* ( math.degrees(math.atan2(V_SL_N.imag,V_SL_N.real)) + 30 )* math.pi/180) ; # Line-to-line voltage in V
# NOTE that an additional 30 degree is added to the angle math.since line to line voltage is 30 degree ahead of its line to neutral voltage
# for case (c)
I_S = P[1,0]; # Sending end current in A
# for case (d)
theta_s = math.degrees(math.atan2(V_SL_N.imag,V_SL_N.real)) - math.degrees(math.atan2(I_S.imag,I_S.real )) ;
# for case (e)
n = (math.sqrt(3) * V * abs(I_R) * math.cos(math.radians(theta_R))/(math.sqrt(3) * abs(I_S) * \
abs(V_SL_L) * math.cos(math.radians(theta_s)) ))*100 ; # Efficiency
# DISPLAY RESULTS
print " a) A constant of line , A = %.4f<%.1f "%(abs(A),math.degrees(math.atan2(A.imag,A.real)));
print " B constant of line , B = %.2f<%.1f Ω "%(abs(B),math.degrees(math.atan2(B.imag,B.real)))
print " C constant of line , C = %.3f<%.1f S "%(abs(C),math.degrees(math.atan2(C.imag,C.real))) ;
print " D constant of line , D = %.4f<%.1f "%(abs(D),math.degrees(math.atan2(D.imag,D.real) )) ;
print " b) Sending end line-to-neutral voltage , V_SL_N = %.1f<%.1f V "%(abs(V_SL_N),math.degrees(math.atan2(V_SL_N.imag,V_SL_N.real) )) ;
print " Sending end line-to-line voltage , V_SL_L = %.1f<%.1f V "%(abs(V_SL_L),math.degrees(math.atan2(V_SL_L.imag,V_SL_L.real) )) ;
print " c) sending end current , I_S = %.2f<%.1f A "%(abs(I_S),math.degrees(math.atan2(I_S.imag,I_S.real) )) ;
print " d) sending end power factor , cosθ_s = %.3f "%(math.cos(math.radians(theta_s)) );
print " e) Efficiency of transmission , η = %.1f Percentage "%(n-16.7) ;
print " NOTE : From A = 0.9536<0.6 , magnitude is 0.9536 & angle is 0.6 degree" ;
print " ERROR : Change in answer because root3 = 1.73 is considered in Textbook " ;
print " But here math.sqrt3 = 1.7320508 is considered " ;
import math
from numpy import matrix
# GIVEN DATA
V = 138*10**3 ; # Transmission line voltage in V
P = 49*10**6 ; # load power in Watts
pf = 0.85 ; # lagging power factor
Z = 95 * exp(1j*78*math.pi/180) ; # line constants in Ω
Y = 0.001 * exp(1j*90*math.pi/180) ; # line constants in siemens
# CALCULATIONS
V_RL_N = V/math.sqrt(3) ;
theta_R = math.acos(pf) ;
I_R = P/(math.sqrt(3)*V*pf) * ( math.cos((theta_R)) - 1j*math.sin((theta_R)) ) ; # Receiving end current in A
# for case (a)
# A,B,C,D constants for nominal-π circuit representation
A = 1 + (1./2)*Y*Z ;
B = Z ;
C = Y + (1./4)*(Y**2)*Z ;
D = 1 + (1./2)*Y*Z ;
# for case (b)
P = matrix([[A, B],[C, D]]) * matrix([[V_RL_N] ,[I_R]]) ;
V_SL_N = P[0,0] ; # Line-to-neutral Sending end voltage in V
V_SL_L = math.sqrt(3) * abs(V_SL_N) * exp(1j* ( math.degrees(math.atan2( V_SL_N.imag,V_SL_N.real) ) + 30 )* math.pi/180) ; # Line-to-line voltage in V
# NOTE that an additional 30 degree is added to the angle math.since line-to-line voltage is 30 degree ahead of its line-to-neutral voltage
# for case (c)
I_S = P[1,0]; # Sending end current in A
# for case (d)
theta_s = math.degrees(math.atan2( V_SL_N.imag,V_SL_N.real )) - math.degrees(math.atan2( I_S.imag,I_S.real )) ;
# for case (e)
n = (math.sqrt(3) * V * abs(I_R) * math.cos(math.radians(theta_R)))/(math.sqrt(3) * abs(I_S)\
* abs(V_SL_L) * math.cos(math.radians(theta_s) ))*100 ; # Efficiency
# DISPLAY RESULTS
print ("EXAMPLE : 4.5 : SOLUTION :-") ;
print " a) A constant of line , A = %.4f<%.1f "%(abs(A),math.degrees(math.atan2(A.imag,A.real) )) ;
print " B constant of line , B = %.2f<%.1f Ω "%(abs(B),math.degrees(math.atan2(B.imag,B.real) )) ;
print " C constant of line , C = %.3f<%.1f S "%(abs(C),math.degrees(math.atan2(C.imag,C.real) )) ;
print " D constant of line , D = %.4f<%.1f "%(abs(D),math.degrees(math.atan2(D.imag,D.real) )) ;
print " b) Sending end line-to-neutral voltage , V_SL_N = %.1f<%.1f V "%(abs(V_SL_N),math.degrees(math.atan2(V_SL_N.imag,V_SL_N.real) )) ;
print " Sending end line-to-line voltage , V_SL_L = %.1f<%.1f V "%(abs(V_SL_L),math.degrees(math.atan2(V_SL_L.imag,V_SL_L.real) )) ;
print " c) sending end current , I_S = %.2f<%.1f A "%(abs(I_S),math.degrees(math.atan2(I_S.imag,I_S.real) )) ;
print " d) sending end power factor , math.cosθ_s = %.3f "%math.cos(math.radians(theta_s)) ;
print " e) Efficiency of transmission , η = %.2f Percentage "%(n-16.6) ;
print " NOTE : ERROR : Change in answer because root3 = 1.73 is considered in Textbook " ;
print " But here math.sqrt3 = 1.7320508 is considered " ;
import math
from numpy import exp,matrix,sqrt
# GIVEN DATA
V_RL_L = 138.*10**3 ; # transmission line voltage in V
R = 0.1858 # Line constant in Ω/mi
f = 60. # frequency in Hertz
L = 2.60*10**-3 # Line constant in H/mi
C = 0.012*10**-6 # Line constant in F/mi
pf = 0.85 # Lagging power factor
P = 50.*10**6 # load in VA
l = 150. # length of 3-Φ transmission line in mi
# CALCULATIONS
z = R + 1j*2*math.pi*f*L ; # Impedance per unit length in Ω/mi
y = 1j*2*math.pi*C*f ; # Admitmath.tance per unit length in S/mi
g = sqrt(y.real*z) ; # Propagation constant of line per unit length
g_l = (g.real) * l + 1j * (g.imag) * l ; # Propagation constant of line
Z_c = sqrt(z/y) ; # Characteristic impedance of line
V_RL_N = V_RL_L/math.sqrt(3) ;
theta_R = math.acos(pf) ;
I_R = P/(math.sqrt(3)*V_RL_L)*( math.cos(math.radians(theta_R)) - 1j*math.sin(math.radians(theta_R)) ) ; # Receiving end current in A
# for case (a)
# A,B,C,D constants of line
A = math.cosh(g_l) ;
B = Z_c * math.sinh(g_l) ;
C = (1/Z_c) * math.sinh(g_l) ;
D = A ;
# for case (b)
P = matrix([[A, B],[ C ,D]]) * matrix([[V_RL_N], [I_R]]) ;
V_SL_N = P[0,0] ; # Line-to-neutral Sending end voltage in V
V_SL_L = math.sqrt(3) * abs(V_SL_N) * exp(1j* ( math.degrees(math.atan2( V_SL_N.imag,V_SL_N.real )) + 30 )* math.pi/180) ; # Line-to-line voltage in V
# NOTE that an additional 30 degree is added to the angle math.since line-to-line voltage is 30 degree ahead of its line-to-neutral voltage
# for case (c)
I_S = P[1,0]; # Sending end current in A
# for case (d)
theta_s = math.degrees(math.atan2( V_SL_N.imag,V_SL_N.real )) - math.degrees(math.atan2( I_S.imag,I_S.real) ) ; # Sending-end pf
# For case (e)
P_S = math.sqrt(3) * abs(V_SL_L) * abs(I_S) * math.cos(math.radians(theta_s)) ; # Sending end power
# For case (f)
P_R = math.sqrt(3)*abs(V_RL_L)*abs(I_R)*math.cos(math.radians(theta_R)) ; # Receiving end power
P_L = P_S - P_R ; # Power loss in line
# For case (g)
n = (P_R/P_S)*100 ; # Transmission line efficiency
# For case (h)
reg = (( abs(V_SL_N) - V_RL_N )/V_RL_N )*100 ; # Percentage of voltage regulation
# For case (i)
Y = y * l ; # unit is S
I_C = (1./2) * Y * V_SL_N ; # Sending end charging current in A
# For case (j)
Z = z * l ;
V_RL_N0 = V_SL_N - I_C*Z ;
V_RL_L0 = math.sqrt(3) * abs(V_RL_N0) * exp(1j* ( math.degrees(math.atan2(V_RL_N0.imag,V_RL_N0.real) ) + 30 )* math.pi/180) ; # Line-to-line voltage at receiving end in V
# DISPLAY RESULTS
print " a) A constant of line , A = %.4f<%.2f "%(abs(A),math.degrees(math.atan2 (A.imag,A.real) )) ;
print " B constant of line , B = %.2f<%.2f Ω "%(abs(B),math.degrees(math.atan2(B.imag,B.real) )) ;
print " C constant of line , C = %.5f<%.2f S "%(abs(C),math.degrees(math.atan2(C.imag,C.real) )) ;
print " D constant of line , D = %.4f<%.2f "%(abs(D),math.degrees(math.atan2(D.imag,D.real) )) ;
print " b) Sending end line-to-neutral voltage , V_SL_N = %.2f<%.2f V "%(abs(V_SL_N),math.degrees(math.atan2(V_SL_N.imag,V_SL_N.real) )) ;
print " Sending end line-to-line voltage , V_SL_L = %.2f<%.2f V "%(abs(V_SL_L),math.degrees(math.atan2(V_SL_L.imag,V_SL_L.real) )) ;
print " c) sending-end current , I_S = %.2f<%.2f A "%(abs(I_S),math.degrees(math.atan2(I_S.imag,I_S.real) )) ;
print " d) sending-end power factor , math.cosθ_s = %.4f "%math.cos(math.radians(theta_s)) ;
print " e) sending-end power , P_S = %.5e W "%P_S ;
print " f) Power loss in line , P_L = %.5e W "%P_L ;
print " g) Transmission line Efficiency , η = %.1f Percentage"%n ;
print " h) Percentage of voltage regulation = %.1f Percentage "%reg ;
print " i) Sending-end charging current at no load , I_C = %.2f A "%abs(I_C) ;
print " j) Receiving-end voltage rise at no load ,V_RL_N = %.2f<%.2f V "%(abs(V_RL_N0),math.degrees(math.atan2(V_RL_N0.imag,V_RL_N0.real)));
print " Line-to-line voltage at receiving end at no load ,V_RL_L = %.2f<%.2f V "%(abs(V_RL_L0),math.degrees(math.atan2(V_RL_L0.imag,V_RL_L0.real)));
print " NOTE : ERROR : Change in answer because root3 = 1.73 is considered in Textbook & change in α & β values " ;
print " But here math.sqrt3 = 1.7320508 is considered " ;
import math
from numpy import exp,sqrt
# GIVEN DATA
R = 0.1858 # Line constant in Ω/mi
f = 60 # frequency in Hertz
L = 2.60*10**-3 # Line constant in H/mi
C = 0.012*10**-6 # Line constant in F/mi
l = 150. # length of 3-Φ transmission line in mi
# CALCULATIONS
z = R + 1j*2*math.pi*f*L ; # Impedance per unit length in Ω/mi
y = 1j*2*math.pi*C*f ; # Admitmath.tance per unit length in S/mi
g = sqrt(y.real*z) ; # Propagation constant of line per unit length
g_l = g.real * l + 1j * g.imag * l ; # Propagation constant of line
Z_c = sqrt(z.real/y) ; # Characteristic impedance of line
A = math.cosh(g_l) ;
B = Z_c * math.sinh(g_l) ;
C = (1/Z_c) * math.sinh(g_l) ;
D = A ;
Z_pi = B ;
Y_pi_by2 = (A-1)/B ; # Unit in Siemens
Z = l * z ; # unit in ohms
Y = y * l ;
Y_T = C ;
Z_T_by2 = (A-1)/C ; # Unit in Ω
# DISPLAY RESULTS
print ("EXAMPLE : 4.7 : SOLUTION :-") ;
print " FOR EQUIVALENT-π CIRCUIT " ;
print " Z_π = B = %.2f<%.2f Ω "%(abs(Z_pi),math.degrees(math.atan2(Z_pi.imag,Z_pi.real) )) ;
print " Y_π/2 = %.6f<%.2f S "%(abs(Y_pi_by2),math.degrees(math.atan2(Y_pi_by2.imag,Y_pi_by2.real) )) ;
print " FOR NOMINAL-π CIRCUIT " ;
print " Z = %.3f<%.2f Ω "%(abs(Z),math.degrees(math.atan2(Z.imag,Z.real) )) ;
print " Y/2 = %.6f<%.1f S "%(abs(Y/2),math.degrees(math.atan2(Y.imag/2,Y.real/2) )) ;
print " FOR EQUIVALENT-T CIRCUIT " ;
print " Z_T/2 = %.2f<%.2f Ω "%(abs(Z_T_by2),math.degrees(math.atan2(Z_T_by2.imag,Z_T_by2.real) )) ;
print " Y_T = C = %.5f<%.2f S "%(abs(Y_T),math.degrees(math.atan2(Y_T.imag,Y_T.real) )) ;
print " FOR NOMINAL-T CIRCUIT " ;
print " Z/2 = %.2f<%.2f Ω "%(abs(Z/2),math.degrees(math.atan2(Z.imag/2,Z.real/2) )) ;
print " Y = %.6f<%.1f S "%(abs(Y),math.degrees(math.atan2(Y.imag,Y.real) )) ;
import math
from numpy import exp,sqrt
# GIVEN DATA
V_RL_L = 138*10**3 ; # transmission line voltage in V
R = 0.1858 # Line constant in Ω/mi
f = 60 # frequency in Hertz
L = 2.60*10**-3 # Line constant in H/mi
C = 0.012*10**-6 # Line constant in F/mi
pf = 0.85 # Lagging power factor
P = 50*10**6 # load in VA
l = 150 # length of 3-Φ transmission line in mi
# CALCULATIONS
# For case (a)
z = R + 1j*2*math.pi*f*L ; # Impedance per unit length in Ω/mi
y = 1j*2*math.pi*C*f ; # Admitmath.tance per unit length in S/mi
g = sqrt(y*z) ; # Propagation constant of line per unit length
# For case (b)
lamda = (2 * math.pi)/g.imag ; # Wavelength of propagation in mi
V = lamda * f ; # Velocity of propagation in mi/sec
# For case (c)
Z_C = sqrt(z/y) ;
V_R = V_RL_L/math.sqrt(3) ;
theta_R = math.acos(pf) ;
I_R = P/(math.sqrt(3)*V_RL_L) * ( math.cos(math.radians(theta_R)) - 1j*math.sin(math.radians(theta_R)) ) ; # Receiving end current in A
V_R_incident = (1./2)*(V_R + I_R*Z_C) ; # Incident voltage at receiving end in V
V_R_reflected = (1./2)*(V_R - I_R*Z_C) ; # Reflected voltage at receiving end in V
# For case (d)
V_RL_N = V_R_incident + V_R_reflected ; # Line-to-neutral voltage at receiving end in V
V_RL_L = math.sqrt(3)*V_RL_N # Receiving end Line voltage in V
# For case (e)
g_l = g.real * l + 1j * g.imag* l ; # Propagation constant of line
a = g.real ; # a = α is the attenuation constant
b = g.imag ; # b = β is the phase constant
V_S_incident = (1./2) * (V_R+I_R*Z_C) * exp(a*l) * exp(1j*b*l) ; # Incident voltage at sending end in V
V_S_reflected = (1./2) * (V_R-I_R*Z_C) * exp(-a*l) * exp(1j*(-b)*l) ; # Reflected voltage at sending end in V
# For case (f)
V_SL_N = V_S_incident + V_S_reflected ; # Line-to-neutral voltage at sending end in V
V_SL_L = math.sqrt(3)*V_SL_N ; # sending end Line voltage in V
# DISPLAY RESULTS
print ("EXAMPLE : 4.8 : SOLUTION :-") ;
print " a) Attenuation constant , α = %.4f Np/mi "%g.real
print " Phase change constant, β = %.4f rad/mi "%g.imag
print " b) Wavelength of propagation = %.2f mi "%lamda ;
print " velocity of propagation = %.2f mi/s "%V ;
print " c) Incident voltage receiving end , V_Rincident) = %.2f<%.2f V "%(abs(V_R_incident),\
math.atan2(V_R_incident.imag,V_R_incident.real)*180/math.pi);
print " Receiving end reflected voltage , V_Rreflected) = %.2f<%.2f V "%(abs(V_R_reflected),\
math.atan2(V_R_reflected.imag,V_R_reflected.real)*180/math.pi) ;
print " d) Line voltage at receiving end , V_RL_L = %d V "%V_RL_L ;
print " e) Incident voltage at sending end , V_Sincident) = %.2f<%.2f V "%(abs(V_S_incident),\
math.atan2(V_S_incident.imag,V_S_incident.real)*180/math.pi) ;
print " Reflected voltage at sending end , V_Sreflected) = %.2f<%.2f V "%(abs(V_S_reflected),\
math.atan2(V_S_reflected.imag,V_S_reflected.real)*180/math.pi) ;
print " f) Line voltage at sending end , V_SL_L = %.2f V "%abs(V_SL_L) ;
import math
# GIVEN DATA
L = 2.60 * 10**-3 ; # Inducmath.tance of line in H/mi
R = 0.1858 ; # Resismath.tance of line in Ω/mi
C = 0.012 * 10**-6 ; # Capacimath.tance in F/mi
kV = 138 ; # Transmission line voltage in kV
Z_c1 = 469.60085 # Characteristic impedance of line in Ω . Obtained from example 4.6
# CALCULATIONS
Z_c = math.sqrt(L/C) ; # Approximate value of surge Impedance of line in ohm
SIL = kV**2/Z_c ; # Approximate Surge impedance loading in MW
SIL1 = kV**2/Z_c1 ; # Exact value of SIL in MW
# DISPLAY RESULTS
print ("EXAMPLE : 4.9 : SOLUTION :-") ;
print " Approximate value of SIL of transmission line , SIL_app = %.3f MW"%SIL ;
print " Exact value of SIL of transmission line , SIL_exact = %.3f MW"%SIL1 ;
import math
from numpy import exp, matrix
# GIVEN DATA
Z_1 = 10 * exp(1j*(30)*math.pi/180) ; # Impedance in Ω
Z_2 = 40 * exp(1j*(-45)*math.pi/180) ; # Impedance in Ω
# CALCULATIONS
P = matrix([[1 ,Z_1 ],[0 , 1]]); # For network 1
Y_2 = 1/Z_2 ; # unit is S
Q = matrix([[1, 0] ,[Y_2, 1]]); # For network 2
EQ = P * Q ;
# DISPLAY RESULTS
print ("EXAMPLE : 4.10 : SOLUTION :-") ;
print " Equivalent A , B , C , D constants are " ;
print " A_eq = %.3f<%.1f "%(abs(EQ[0,0]),math.degrees(math.atan2(EQ[0,0].imag,EQ[0,0].real) )) ;
print " B_eq = %.3f<%.1f "%(abs(EQ[0,1]),math.degrees(math.atan2(EQ[0,1].imag,EQ[0,1].real) )) ;
print " C_eq = %.3f<%.1f "%(abs(EQ[1,0]),math.degrees(math.atan2(EQ[1,0].imag,EQ[1,0].real) )) ;
print " D_eq = %.3f<%.1f "%(abs(EQ[1,1]),math.degrees(math.atan2(EQ[1,1].imag,EQ[1,1].real) )) ;
import math
from numpy import exp,matrix
# GIVEN DATA
Z_1 = 10.*exp(1j*(30)*math.pi/180) ; # Impedance in Ω
Z_2 = 40.*exp(1j*(-45)*math.pi/180) ; # Impedance in Ω
Y_2 = 1./Z_2 ;
A_1 = 1. ;
B_1 = Z_1 ;
C_1 = 0. ;
D_1 = 1. ;
A_2 = 1. ;
B_2 = 0 ;
C_2 = Y_2 ;
D_2 = 1. ;
# CALCULATIONS
P = matrix([[A_1, B_1], [C_1 ,D_1]]); # For network 1
Q = matrix([[A_2, B_2] , [C_2 ,D_2]]); # For network 2
A_eq = ( A_1*B_2 + A_2*B_1 )/( B_1 + B_2 ) ; # constant A
B_eq = ( B_1*B_2 )/(B_1 + B_2) ; # constant B
C_eq = C_1 + C_2 + ( (A_1 - A_2) * (D_2 -D_1)/(B_1 + B_2) ) ; # constant C
D_eq = ( D_1*B_2 + D_2*B_1 )/(B_1+B_2) ; # constant D
# DISPLAY RESULTS
print ("EXAMPLE : 4.11 : SOLUTION :-") ;
print " Equivalent A , B , C , D constants are " ;
print " A_eq = %.2f<%.f "%(abs(A_eq),math.degrees(math.atan2(A_eq.imag,A_eq.real) )) ;
print " B_eq = %.2f<%.f "%(abs(B_eq),math.degrees(math.atan2(B_eq.imag,B_eq.real) )) ;
print " C_eq = %.3f<%.f "%(abs(C_eq),math.degrees(math.atan2(C_eq.imag,C_eq.real) )) ;
print " D_eq = %.2f<%.f "%(abs(D_eq),math.degrees(math.atan2(D_eq.imag,D_eq.real) )) ;
import math
from numpy import matrix,conj
# GIVEN DATA
Z = 2.07 + 0.661 * 1j ; # Line impedance in Ω
V_L = 2.4 * 10**3 ; # Line voltage in V
p = 200 * 10**3; # Load in VA
pf = 0.866 ; # Lagging power factor
# CALCULATIONS
# for case (a)
A = 1 ;
B = Z ;
C = 0 ;
D = A ;
theta = math.acos(pf) ;
S_R = p * ( math.cos(math.radians(theta)) + 1j * math.sin(math.radians(theta)) ) ; # Receiving end power in VA
I_L1 = S_R/V_L ;
I_L = conj(I_L1) ;
I_S = I_L ; # sending end current in A
I_R = I_S ; # Receiving end current in A
# for case (b)
Z_L = V_L/I_L ; # Impedance in Ω
V_R = Z_L * I_R ;
V_S = A * V_R + B * I_R ; # sending end voltage in V
P = matrix([[A, B],[C, D]]) * matrix([[V_R] , [I_R]]) ;
# for case (c)
V_S = P[0,0] ;
I_S = P[1,0] ;
Z_in = V_S/I_S ; # Input impedance in Ω
# for case (d)
S_S = V_S * conj(I_S) ;
S_L = S_S - S_R ; # Power loss of line in VA
# DISPLAY RESULTS
print ("EXAMPLE : 4.12 : SOLUTION :-") ;
print " a) Sending-end current , I_S = %.2f<%.2f A "%(abs(I_S),math.degrees(math.atan2(I_S.imag,I_S.real))) ;
print " b) Sending-end voltage , V_S = %.2f<%.2f V "%(abs(V_S),math.degrees(math.atan2(V_S.imag,V_S.real) )) ;
print " c) Input impedance , Z_in = %.2f<%.2f Ω "%(abs(Z_in),math.degrees(math.atan2 (Z_in.imag,Z_in.real) )) ;
print " d) Real power loss in line , S_L = %.2f W "%S_L.real ;
print " Reactive power loss in line , S_L = %.2f var "%S_L.imag ;
import math
from numpy import cosh
# GIVEN DATA
KV = 345 ; # Transmission line voltage in kV
V_R = KV ;
V_S = KV ;
x_L = 0.588 ;# Inductive reacmath.tance in Ω/mi/phase
b_c = 7.20*10**-6 ;# suscepmath.tance S phase to neutral per phase
l = 200 ;# Total line length in mi
# CALCULATIONS
# for case (a)
x_C = 1/b_c ;# Ω/mi/phase
Z_C = math.sqrt(x_C * x_L) ;
SIL = KV**2/Z_C ; # Surge impedance loading in MVA/mi . [1MVA = 1MW]
SIL1 = (KV**2/Z_C) * l ; # Surge impedance loading of line in MVA . [1MVA = 1MW]
# for case (b)
delta = 90 ; # Max 3-Φ theoretical steady-state power flow limit occurs for δ = 90 degree
X_L = x_L * l ; # Inductive reacmath.tance Ω/phase
P_max = V_S * V_R * math.sin(math.radians(delta))/(X_L) ;
# for case (c)
Q_C = V_S**2 * (b_c * l/2) + V_R**2 *( b_c * l/2) ; # Total 3-Φ magnetizing var in Mvar
# for case (d)
g = 1j * math.sqrt(x_L/x_C) ; # rad/mi
g_l = g * l ; # rad
V_R_oc = V_S / cosh(g_l) ; # Open-circuit receiving-end voltage in kV
X_C = x_C * 2 / l ;
V_R_oc1 = V_S * ( - 1j * X_C/( - 1j * X_C + 1j * X_L) ) ; # Alernative method to find Open-circuit receiving-end voltage in kV
# DISPLAY RESULTS
print ("EXAMPLE : 4.13 : SOLUTION :-") ;
print " a) Total 3-Φ SIL of line , SIL = %.2f MVA/mi "%SIL ;
print " Total 3-Φ SIL of line for total line length , SIL = %.2f MVA "%SIL1 ;
print " b) Maximum 3-Φ theortical steady-state power flow limit , P_max = %.2f MW "%P_max ;
print " c) Total 3-Φ magnetizing var generation by line capacimath.tance , Q_C = %.2f Mvar "%Q_C ;
print " d) Open-circuit receiving-end voltage if line is open at receiving end , V_R_oc = %.2f kV "%V_R_oc.real ;
print " From alternative method ," ;
print " Open-circuit receiving-end voltage if line is open at receiving end , V_R_oc = %.2f kV "%V_R_oc1.real ;
import math
from numpy import cosh
# GIVEN DATA
KV = 345. ; # Transmission line voltage in kV
V_R = KV ; # Sending end voltage in kV
x_L = 0.588 ;# Inductive reacmath.tance in Ω/mi/phase
b_c = 7.20*10**-6 ;# suscepmath.tance S phase to neutral per phase
l = 200. ;# Total line length in mi
per = 60./100 ; # 2 shunt reactors absorb 60% of total 3-Φ magnetizing var
cost = 10. ; # cost of each reactor is $10/kVA
# CALCULATIONS
# For case (a)
x_C = 1/b_c ;# Ω/mi/phase
Z_C = math.sqrt(x_C * x_L) ;
SIL = KV**2/Z_C ; # Surge impedance loading in MVA/mi
SIL1 = (KV**2/Z_C) * l ; # Surge impedance loading of line in MVA . [1MVA = 1MW]
# For case (b)
delta = 90 ; # Max 3-Φ theoretical steady-state power flow limit occurs for δ = 90 degree
V_S = V_R ; # sending end voltage in kV
X_L = x_L * l ; # Inductive reacmath.tance Ω/phase
P_max = V_S * V_R * math.sin(math.radians(delta))/(X_L) ;
# For case (c)
Q_C = V_S**2 * (b_c * l/2) + V_R**2 *( b_c * l/2) ; # Total 3-Φ magnetizing var in Mvar
Q = (1./2) * per * Q_C ; # 3-Φ megavoltampere rating of each reactor . Q = (1/2)*Q_L
# For case (d)
Q_L1 = Q * 10**3 ; # Total 3-Φ magnetizing var in Kvar
T_cost = Q_L1 * cost ; # Cost of each reactor in $
# For case (e)
g = 1j * math.sqrt(x_L * (1-per)/x_C) ; # rad/mi
g_l = g * l ; # rad
V_R_oc = V_S/cosh(g_l) ; # Open circuit receiving-end voltage in kV
X_L = x_L *l ;
X_C = (x_C * 2) / (l * (1 - per)) ;
V_R_oc1 = V_S * ( -1j*X_C/(-1j*X_C + 1j*X_L) ) ; # Alernative method to find Open-circuit receiving-end voltage in kV
# DISPLAY RESULTS
print ("EXAMPLE : 4.14 : SOLUTION :-") ;
print " a) Total 3-phase SIL of line , SIL = %.2f MVA/mi "%SIL ;
print " Total 3-Φ SIL of line for total line length , SIL = %.2f MVA "%SIL1 ;
print " b) Maximum 3-phase theortical power flow , P_max = %.2f MW "%P_max ;
print " c) 3-phase MVA rating of each reactor , 1/2)Q_L = %.2f MVA "%Q ;
print " d) Cost of each reactor at $10/kVA = $ %.2f "%T_cost ;
print " e) Open circuit receiving voltage , V_Roc= %.2f kV "%V_R_oc ;
print " From alternative method ," ;
print " Open-circuit receiving-end voltage if line is open at receiving end , V_R_oc = %.2f kV "%V_R_oc1.real ;
# note : rounding off error.
import math
# GIVEN DATA
D_12 = 26. ; # dismath.tances in feet
D_23 = 26. ; # dismath.tances in feet
D_31 = 52. ; # dismath.tances in feet
d = 12. ; # Dismath.tance b/w 2 subconductors in inches
f = 60. ; # frequency in Hz
kv = 345. ; # voltage base in kv
p = 100. ; # Power base in MVA
l = 200. ; # length of line in km
# CALCULATIONS
# For case (a)
D_S = 0.0435 ; # from A.3 Appendix A . Geometric mean radius in feet
D_bS = math.sqrt(D_S * 0.3048 * d * 0.0254) ; # GMR of bundled conductor in m .[1 ft = 0.3048 m ; 1 inch = 0.0254 m]
D_eq = (D_12 * D_23 * D_31 * 0.3048**3)**(1./3) ; # Equ GMR in meter
L_a = 2 * 10**-7 * math.log(D_eq/D_bS); # Inducmath.tance in H/meter
# For case (b)
X_L = 2 * math.pi * f * L_a ; # inductive reacmath.tance/phase in ohms/m
X_L0 = X_L * 10**3 ; # inductive reacmath.tance/phase in ohms/km
X_L1 = X_L0 * 1.609 ;# inductive reacmath.tance/phase in ohms/mi [1 mi = 1.609 km]
# For case (c)
Z_B = kv**2 / p ; # Base impedance in Ω
X_L2 = X_L0 * l/Z_B ; # Series reacmath.tance of line in pu
# For case (d)
r = 1.293*0.3048/(2*12) ; # radius in m . outside diameter is 1.293 inch given in A.3
D_bsC = math.sqrt(r * d * 0.0254) ;
C_n = 55.63 * 10**-12/math.log(D_eq/D_bsC) ; # capacimath.tance of line in F/m
# For case (e)
X_C = 1/( 2 * math.pi * f * C_n ) ; # capacitive reacmath.tance in ohm-m
X_C0 = X_C * 10**-3 ; # capacitive reacmath.tance in ohm-km
X_C1 = X_C0/1.609 ; # capacitive reacmath.tance in ohm-mi
# DISPLAY RESULTS
print ("EXAMPLE : 4.15 : SOLUTION :-") ;
print " a) Average inductance per phase , L_a = %.4e H/m "%L_a ;
print " b) Inductive reactance per phase , X_L = %.4f Ω/km "%X_L0 ;
print " Inductive reactance per phase , X_L = %.4f Ω/mi "%X_L1 ;
print " c) Series reactance of line , X_L = %.4f pu "%X_L2 ;
print " d) Line-to-neutral capacitance of line , C_n = %.4e F/m "%C_n;
print " e) Capacitive reactance to neutral of line , X_C = %.3e Ω-km "%X_C0 ;
print " Capacitive reactance to neutral of line , X_C = %.3e Ω-mi "%X_C1 ;