# Test results



# Question 1

Let us consider the two-bus system. The two buses are connected to each other through a line of impedance $R+jX$. We are working in sinusoidal steady-state and the voltage phasors of bus 1 and 2 are respectively equal to $\bar{V}_1 = V_1\angle \theta_1$ and $\bar{V}_2 = V_2\angle \theta_2$.




Q1.a An apparent power $S_{12} = P_{12} + jQ_{12}$ flows from bus 1 to bus 2, derive its expression. Only the variables $\bar{V}_1$, $\bar{V}_2$, $R$ and $X$ should appear in the final expression. Hint: using Ohm's Law, express the current $\bar{I}$ with respect to $\bar{V}_1$ and $\bar{V}_2$.

Answer : 
\begin{align}
S_{12} &= \bar{V_1}\bar{I}_{12}^*\\
       &= \bar{V_1}\left(\frac{\bar{V_1}-\bar{V_2}}{jX+R}\right)^*
\end{align}
One can write :
$$Y = \frac{1}{jX+R} = y e^{j\eta}$$
with 
$$y = \sqrt{\left(\frac{R}{R^2+X^2}\right)^2+\left(\frac{X}{R^2+X^2}\right)^2} \text{   and  } \eta = \tan^{-1}\left(\frac{-X}{R}\right)$$
thus we have :
\begin{align}
S_{12} &= \left(\bar{V_1}\bar{V_1}^*-\bar{V_1}\bar{V_2}^*\right)y e^{-j\eta}\\
       &= y\left(V_1^2 e^{j(-\eta)}-V_1 V_2 e^{j(\theta_1-\theta_2-\eta)}\right)
\end{align}

Q1.b Starting from the expression $S_{12} = y\left(V_1^2 e^{j(-\eta)}-V_1 V_2 e^{j(\theta_1-\theta_2-\eta)}\right)$ where $ y e^{j\eta} = \frac{1}{jX+R}$, derive the expressions of $P_{12}$ and $Q_{12}$.

Answer : 
$$P_{12} = Re\{S_{12}\} = y V_1^2 \cos(\eta) - y V_1 V_2 \cos(\theta_1-\theta_2-\eta)$$
$$Q_{12} = Im\{S_{12}\} = -y V_1^2 \sin(\eta) - y V_1 V_2 \sin(\theta_1-\theta_2-\eta)$$

Q1.c Suppose that you have a line inductance per km $l = 10^{-2}$ H/km and a line resistance per km $r = 0.03\Omega$/km. Assume a line length $L=$10km. The system is operated at a frequency $f=50$Hz. Finally, suppose $\bar{V}_1 = 380\angle 0^{\circ{}}$ kV and $\bar{V}_2 = 375 \angle 5^{\circ{}}$ kV. Calculate the values of $P_{12}$ and $Q_{12}$ in MW and in Mvar, respectively. 


```python
import numpy as np

L_per_km = 1e-2          #H/km
R_per_km = 3e-2          #Ohm/km
f = 50                   #Hz
V1 = 380e3               #V
theta1 = 0               #deg
V2 = 375e3               #V
theta2 = 5               #deg
line_length = 10         #km

X = L_per_km*f*2*np.pi*line_length
R = R_per_km*line_length

eta = np.arctan(-X/R)
y = np.sqrt((R/(R**2+X**2))**2+(X/(R**2+X**2))**2)

P12 = y*V1**2*np.cos(eta)-y*V1*V2*np.cos((theta1-theta2)*np.pi/180-eta)
Q12 = -y*V1**2*np.sin(eta)-y*V1*V2*np.sin((theta1-theta2)*np.pi/180-eta)
print(f'Active power P12 : {round(P12/1e6,3)} MW, Reactive power Q12 : {round(Q12/1e6,3)} Mvar')
```

    Active power P12 : -394.553 MW, Reactive power Q12 : 81.507 Mvar


Q1.d Most of the time, in transmission systems, the line resistance is neglected as the ratio $\frac{X}{R}>>1$. Now, assume a line resistance of 0$\Omega$ and calculate $P_{12}$ and $Q_{12}$. 


```python
import numpy as np

L_per_km = 1e-2         #H/km
R_per_km = 0          #Ohm/km
f = 50                   #Hz
V1 = 380e3               #V
theta1 = 0               #deg
V2 = 375e3               #V
theta2 = 5               #deg
line_length = 10         #km

X = L_per_km*f*2*np.pi*line_length
R = R_per_km*line_length

eta = -np.pi/2
y = np.sqrt((R/(R**2+X**2))**2+(X/(R**2+X**2))**2)

P12 = y*V1**2*np.cos(eta)-y*V1*V2*np.cos((theta1-theta2)*np.pi/180-eta)
Q12 = -y*V1**2*np.sin(eta)-y*V1*V2*np.sin((theta1-theta2)*np.pi/180-eta)
print(f'Active power P12 : {round(P12/1e6,3)} MW, Reactive power Q12 : {round(Q12/1e6,3)} Mvar')
```

    Active power P12 : -395.331 MW, Reactive power Q12 : 77.739 Mvar


Q1.e As you may have seen, the impact of neglecting the line resistance stays small and the assumption can be considered as valid. Write the expressions of $P_{12}$, $Q_{12}$ as well as $P_{21}$,$Q_{21}$ (active and reactive power flowing from bus 2 to bus 1) if the line resistance is neglected. Only the variables $V_1$, $V_2$, $\theta_1$, $\theta_2$ and $X$ should appear in the final expressions. 

Answer : 
$$P_{12} = \frac{V_1V_2 \sin(\theta_1-\theta_2)}{X}$$
$$Q_{12} = \frac{V_1^2-V_1V_2\cos(\theta_1-\theta_2)}{X}$$
$$P_{21} = \frac{V_2V_1 \sin(\theta_2-\theta_1)}{X}$$
$$Q_{21} = \frac{V_2^2-V_2V_1\cos(\theta_2-\theta_1)}{X}$$


# Question 2

Q2. Consider the circuit shown below. The following parameters are given :
$\bar{V} = 120\angle 0$, $C = 200\mu F$, $L = 30 mH$, $R = 5\Omega$. The circuit is operated at a frequency $f=50Hz$.



Q2.1 Find the total apparent, active and reactive powers consumed by the circuit. Finally, compute the power factor and indicate if it is leading or lagging. 



```python
import numpy as np
import cmath

#values given
V = cmath.rect(120,0) #V
C = 200e-6             #F
L = 30e-3              #H
R = 5                  #Ohms
f = 50                 #Hz

#find the reactances
omega = 2*np.pi*f      #rad/s
Xc = -1/(omega*C)      #Ohms
Xl = omega*L           #Ohms

#find the eqivalent impedance
Zeq = 1/(1/(1j*Xc)+1/(R+1j*Xl))
print(f'Zeq : {cmath.polar(Zeq)} Ohms')
#find the current flowing through the circuit
I = V/Zeq
print(f'Total current : {cmath.polar(I)} A')
#compute the apparent power
S = V*np.conj(I) 
P = np.real(S)
Q = np.imag(S)

#calculate the power factor
cosPhi = P/(abs(S))
#or phi = angleV-angleI => cos(phi)

#print the results
print(f'Apparent power  : {S} VA, active power {P} W, reactive power {Q} var')
print(f'Power factor : {cosPhi}')

```

    Zeq : (20.724560478502138, 0.4266481389796722) Ohms
    Total current : (5.7902313597664765, -0.4266481389796722) A
    Apparent power  : (632.5419669350566+287.5348336123867j) VA, active power 632.5419669350566 W, reactive power 287.5348336123867 var
    Power factor : 0.9103579339539083


Q2.2 Assuming that we want a power factor equals 1, what would be the value of the capacitor knowing that the others parameters are kept the same?


```python
import numpy as np
import cmath

#values given
V = cmath.rect(120,0)  #V
cosPhi = 1             #
L = 30e-3              #H
R = 5                  #Ohms
f = 50                 #Hz

#find the reactances
omega = 2*np.pi*f      #rad/s
Xl = omega*L           #Ohms

#the apparent power is equal to the active power consumed by the circuit because cosPhi = 1
#thus, the power consumed by the resistor
#real part of the apparent power consumed by branch R+jXl = active power consumed by the circuit = apparent power consumed by the circuit
S = np.real(V*np.conj(V/(R+1j*Xl)))
print(f'S = {S} VA')
#find the total current
I = np.conj(abs(S)/V)
print(f'I = {cmath.polar(I)} A')
#find the equivalent impedance
Zeq = V/I
print(f'Zeq = {cmath.polar(Zeq)} Ohms')
#calculate the reactance Xc
#Zeq = 1/(1/(-jXc)+1/(R+jXl)) => Zeq/(R+jXl)-1 = Zeq/(-jXc) => j/Xc = 1/(R+jXl) - 1/Zeq => Xc = j/(-1/(R+jXl)+1/Zeq)
Xc = 1j/(-1/(R+1j*Xl)+1/Zeq)
print(f'Xc = {Xc} Ohms')
C = 1/(Xc*omega)
print(f'C = {C*1e6} uF')  
```

    S = 632.5419669350566 VA
    I = (5.271183057792139, -0.0) A
    Zeq = (22.765287921960844, 0.0) Ohms
    Xc = (12.0773603456343+0j) Ohms
    C = (263.559152889607+0j) uF


346faf975d0c2407dbeb019a4979e419b1a5b4f6
ipynb
Jupyter Notebook
notebooks/Test1_solved.ipynb
bcornelusse/ELEC0447-analysis-power-systems
258c15660ca6b9c16d36372f2533629e53262120
BSD-2-Clause
2020-06-18T07:39:41.000Z
2021-12-07T13:18:22.000Z
notebooks/Test1_solved.ipynb
bcornelusse/ELEC0447-analysis-power-systems
258c15660ca6b9c16d36372f2533629e53262120
BSD-2-Clause
notebooks/Test1_solved.ipynb
bcornelusse/ELEC0447-analysis-power-systems
258c15660ca6b9c16d36372f2533629e53262120
BSD-2-Clause
2020-09-02T13:21:41.000Z
2020-12-21T10:49:28.000Z
Qwen/Qwen-72B
1. YES
2. YES