<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Excercises Electric Machinery Fundamentals
Chapter 2
Problem 2-2
Step1:  Description
A single-phase power system is shown in Figure P2-1.
<img src="figs/FigC_P2-1.jpg" width="70%">
The power source feeds a 100-kVA 14/2.4-kV transformer through a feeder impedance of $38.2 + j140 \Omega$. The transformer’s equivalent series impedance
referred to its low-voltage side is $0.10 + j0.4 \Omega$ . The load on the transformer is 90 kW at 0.8 PF lagging at  $V_\text{load} = 2300\,V$.
Step2:  (a)
What is the voltage at the power source of the system?
(b)
What is the voltage regulation of the transformer?
(c)
How efficient is the overall power system?
SOLUTION
To solve this problem, we will refer the circuit to the secondary (low-voltage) side. The turns ratio of this transformer $a$ is
Step3:  The feeder’s impedance referred to the secondary side is
Step4:  The secondary current $I_S$ is given by 
Step5:  The power factor is 0.80 lagging, so the impedance angel $\theta = \arccos(PF)$ is
Step6:  The phasor current is
Step7:  (a)
The voltage at the power source of this system (referred to the secondary side) is
Step8:  Therefore, the voltage at the power source is
Step9:  (b)
To find the voltage regulation of the transformer, we must find the voltage at the primary side of the transformer (referred to the secondary side) under these conditions
Step10:  There is a voltage drop of 15 V under these load conditions. 
Therefore the voltage regulation of the transformer is
Step11:  (c)
The overall efficiency of the power system will be the ratio of the output power to the input power. The output power supplied to the load is $P_\text{OUT} = 90\,kW$. The input power supplied by the source is
Step12:  Therefore, the efficiency of the power system is
<ASSISTANT_TASK:>
Python Code:
%pylab notebook
%precision 4
Explanation: Excercises Electric Machinery Fundamentals
Chapter 2
Problem 2-2
End of explanation
Zline = 38.2  + 140.0j # [Ohm]
Zeq   =  0.10 +   0.4j # [Ohm]
V_high =  14e3 # [V]
V_low  = 2.4e3 # [V]
Pout   =  90e3 # [W] load
PF     =  0.8  # lagging
VS     = 2.3e3 # [V] secondary voltage
Explanation: Description
A single-phase power system is shown in Figure P2-1.
<img src="figs/FigC_P2-1.jpg" width="70%">
The power source feeds a 100-kVA 14/2.4-kV transformer through a feeder impedance of $38.2 + j140 \Omega$. The transformer’s equivalent series impedance
referred to its low-voltage side is $0.10 + j0.4 \Omega$ . The load on the transformer is 90 kW at 0.8 PF lagging at  $V_\text{load} = 2300\,V$.
End of explanation
a = V_high / V_low
a
Explanation: (a)
What is the voltage at the power source of the system?
(b)
What is the voltage regulation of the transformer?
(c)
How efficient is the overall power system?
SOLUTION
To solve this problem, we will refer the circuit to the secondary (low-voltage) side. The turns ratio of this transformer $a$ is:
End of explanation
Z_line = (1/a)**2 * Zline
print('Z_line = {:.2f} Ω'.format(Z_line))
Explanation: The feeder’s impedance referred to the secondary side is:
$$Z'\text{line} = \left(\frac{1}{a}\right)^2Z\text{line}$$
End of explanation
Is = Pout / (VS*PF)
print('Is = {:.2f} A'.format(Is))
Explanation: The secondary current $I_S$ is given by :
$$I_S = \frac{P_{OUT}}{V_SPF}$$
End of explanation
IS_angle = - arccos(PF)  # negative because lagging PF
print('θ = {:.2f}°'.format(degrees(IS_angle)))
Explanation: The power factor is 0.80 lagging, so the impedance angel $\theta = \arccos(PF)$ is:
End of explanation
IS = Is * (cos(IS_angle)  + sin(IS_angle)*1j)
print('IS = {:.2f} A ∠{:.2f}°'.format(abs(IS), degrees(IS_angle)))
Explanation: The phasor current is:
End of explanation
V_source = VS + IS*Z_line + IS*Zeq
V_source_angle = arctan(V_source.imag/V_source.real) # angle of V_source [rad]
print('V_source = {:.1f} V ∠{:.1f}°'.format(
        abs(V_source), degrees(V_source_angle)))
Explanation: (a)
The voltage at the power source of this system (referred to the secondary side) is:
$$\vec{V}'\text{source}= \vec{V}_S + \vec{I}_SZ'\text{line} + \vec{I}SZ\text{EQ}$$
End of explanation
Vsource = V_source * a                             # [V]
Vsource_angle = arctan(Vsource.imag/Vsource.real)  # angle of Vsource [rad]
print('Vsource = {:.1f} kV ∠{:.1f}°'.format(
        abs(Vsource)/1000,   # display in kV
        degrees(Vsource_angle)))
Explanation: Therefore, the voltage at the power source is:
$$\vec{V}\text{source} = \vec{V}'\text{source} \cdot a$$
End of explanation
VP = VS + IS*Zeq
VP_angle = arctan(VP.imag/VP.real)   # angle of VP [rad]
print('VP = {:.1f} V ∠{:.1f}°'.format(abs(VP), degrees(VP_angle)))
Explanation: (b)
To find the voltage regulation of the transformer, we must find the voltage at the primary side of the transformer (referred to the secondary side) under these conditions:
$$\vec{V}P' = \vec{V}_S + \vec{I}_SZ\text{EQ}$$
End of explanation
VR = (abs(VP)-VS) / VS * 100  # [%]
print('VR = {:.2f} %'.format(VR))
Explanation: There is a voltage drop of 15 V under these load conditions. 
Therefore the voltage regulation of the transformer is:
$$VR = \frac{V_P' - V_S}{V_S} \cdot 100\%$$
End of explanation
R = Z_line.real + Zeq.real
Pin = Pout + abs(IS)**2 * R               # [W]
print('Pin = {:.2f} kW'.format(Pin/1000)) # [kW]
Explanation: (c)
The overall efficiency of the power system will be the ratio of the output power to the input power. The output power supplied to the load is $P_\text{OUT} = 90\,kW$. The input power supplied by the source is:
$$P_\text{IN} = P_\text{OUT} + P_\text{LOSS} = P_\text{OUT} + I^2R$$
End of explanation
eta = Pout/Pin * 100  # [%]
print('η = {:.1f} %'.format(eta)) 
Explanation: Therefore, the efficiency of the power system is:
End of explanation
<END_TASK>