Skip to content

Grid 3Bus Example for Phasor Dynamics #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 21 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
c78fb9e
Added README.md that describes 3Bus equations.
abdourahmanbarry Feb 17, 2025
290ebd0
Update examples/Bus3Phasor/README.md
abdourahmanbarry Feb 24, 2025
86b48eb
Update examples/Bus3Phasor/README.md
abdourahmanbarry Feb 24, 2025
4888ce9
Added 3Bus diagram to README.md in Bus3Phasor folder
abdourahmanbarry Feb 24, 2025
a4c1d21
Indices r and i written before numerical indices
abdourahmanbarry Feb 24, 2025
745d655
Added the diagram of the 3Bus example.
abdourahmanbarry Feb 24, 2025
5a4619d
Added equations in the form f(t, y, y')=0 for the 3bus example
abdourahmanbarry Mar 7, 2025
83a64a6
Added code for the residual of the DAE for the 3Bus example.
abdourahmanbarry Mar 10, 2025
27f3c49
added residual function and testing
abdourahmanbarry Mar 12, 2025
6a2dbfe
Initial working version of example1
abirchfield Mar 11, 2025
313e4c5
Fix minor cherry pick issue.
pelesh Mar 11, 2025
b735546
Update code style for GENROU model and example.
pelesh Mar 12, 2025
1205fe5
Apply pre-commmit fixes
pelesh Mar 12, 2025
419be8d
Updates to CMake and code style.
pelesh Mar 12, 2025
a028a6e
Export all symbols when using MSVSC to build GridKit.
pelesh Mar 12, 2025
ed0e6d2
Merge branch 'genrou-adam-dev' into abdou/phasor_dynamics
abdourahmanbarry Mar 25, 2025
ff9464d
Added classical generator
abdourahmanbarry Apr 10, 2025
fa4b323
Added 3Bus to the list of examples
abdourahmanbarry Apr 10, 2025
159ccdc
Added CMake file in 3Bus example folder
abdourahmanbarry Apr 10, 2025
8d7f00f
Added an example for the second order classical generator
abdourahmanbarry Apr 10, 2025
85d15fd
Added a CMake file for 3Bus example
abdourahmanbarry Apr 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 147 additions & 0 deletions examples/Bus3Phasor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
Notation: $I_{a,b}$ represents the current flowing into Bus b from the branch connecting Bus a and Bus b, $I_{G,a}$ the current from generator a, $I_{L,a}$ the current from load a, and $V_a$ the voltage at Bus a.
Each component is sub-index by the components ID. The 3Bus model is composed of 3 buses, 3 branches, 2 loads and 2 generators. For simplicity in some equation, $I = \left[\begin{array}{c} I_r \\ I_i \end{array}\right]$ to represent complex variables.

## Bus equations:
```math
I_{G,1}+I_{2,1}+I_{3,1}+I_{L,1} = 0
```
```math
I_{L,2}+I_{1,2}+I_{3,2} = 0
```
```math
I_{G,3}+I_{1,3}+I_{2,3} = 0
```

## Branch equations:

(branch connecting Bus 1 and Bus 2)
```math
\left[ \begin{array}{c}
I_{2,1} \\
I_{1,2}
\end{array}\right] =
Y^{[1]}\left[ \begin{array}{c}
V_1 \\
V_2
\end{array}\right]
```

(branch connecting Bus 2 and Bus 3)
```math
\left[ \begin{array}{c}
I_{3,2} \\
I_{2,3}
\end{array}\right] =
Y^{[2]}\left[ \begin{array}{c}
V_2 \\
V_3
\end{array}\right]
```

(branch connecting Bus 1 and Bus 3)
```math
\left[ \begin{array}{c}
I_{3,1} \\
I_{1,3}
\end{array}\right] =
Y^{[3]}\left[ \begin{array}{c}
V_1 \\
V_3
\end{array}\right]
```

## Load equations:
Loads connected to bus 1:
```math
I_{L,1} = \frac{V_1}{R_1}
```
Loads connected to bus 2:
```math
I_{L,2} = \frac{V_2}{R_2}
```

## Generator 1
Generator connected to bus 1:<br>
Differential equations:
```math
\dot{\delta}_1 = \omega_1 \cdot \omega_0
```
```math
\dot{\omega}_1 = \frac{1}{2H_1}\left( \frac{P_{mech,1} - D_1\omega_1}{1+\omega_1} - T_{elec,1}\right)
```
```math
\dot{E}_{qp,1} = \frac{1}{T_{dop,1}}\left( E_{fd,1} - \left( E_{qp,1} + X_{d1,1}\left( I_{d,1} + X_{d3,1}\left( E_{qp,1} - \psi_{dp,1} - X_{d2,1}I_{d,1} \right) \right) + \psi_{dpp,1}\cdot k_{sat,1} \right) \right)
```
```math
\dot{\psi}_{dp,1} = \frac{1}{T_{dopp,1}} \left( E_{qp,1} - \psi_{dp,1} - X_{d2,1} I_{d, 1} \right)
```
```math
\dot{\psi}_{qp,1} = \frac{1}{T_{qopp,1}} \left( E_{dp,1} - \psi_{qp,1} + X_{q2,1}I_{q,1}\right)
```
```math
\dot{E}_{dp,1} = \frac{1}{T_{qop,1}}\left(-E_{dp,1} + X_{qd,1}\psi_{qpp,1}\cdot k_{sat,1} + X_{q1,1} \left(I_{q,1} - X_{q3,1} \left(E_{dp,1} + I_{q,1}X_{q2,1} - \psi_{qp,1}\right)\right)\right)
```
Algebraic equations:
```math
V_{d,1} = -\psi_{qpp,1}(\psi_{qp^{\prime},1}E_{dp,1})(1+\omega_1)
```
```math
V_{q,1} = \psi_{dpp,1}(\psi_{dp^{\prime},1}E_{qp,1})(1+\omega_1)
```
```math
I_{d,1} = I_{G,1, r}\sin(\delta_1) - I_{G,1,i}\cos(\delta_1)
```
```math
I_{q,1} = I_{G,1, r}\cos(\delta_1) + I_{G,1,i}\sin(\delta_1)
```

Network interfaces:
```math
V_{d,1} = V_{1,r}\sin(\delta_1) - V_{1,i}\cos(\delta_1) + I_{d,1} R_{a,1} -I_{q,1} X_{qpp,1}
```
```math
V_{q,1} = V_{1,r}\cos(\delta_1) + V_{1,i}\sin(\delta_1) + I_{d,1}X_{qpp,1} + I_{q,1}R_{a,1}
```
## Generator 3
Generator connected to bus 3:<br>
Differential equations:
```math
\dot{\delta}_3 = \omega_3 \cdot \omega_0
```
```math
\dot{\omega}_3 = \frac{1}{2H_3}\left( \frac{P_{mech,3} - D_3\omega_3}{1+\omega_3} - T_{elec,3}\right)
```
```math
\dot{E_{qp,3}} = \frac{1}{T_{dop,3}}\left( E_{fd,3} - \left( E_{qp,3} + X_{d1,3}\left( I_{d,3} + X_{d3,3}\left( E_{qp,3} - \psi_{dp,3} - X_{d2,3}I_{d,3} \right) \right) + \psi_{dpp,3}\cdot k_{sat,3} \right) \right)
```
```math
\dot{\psi}_{dp,3} = \frac{1}{T_{dopp,3}} \left( E_{qp,3} - \psi_{dp,3} - X_{d2,3} I_{d,3} \right)
```
```math
\dot{\psi}_{qp,3} = \frac{1}{T_{qopp,3}} \left( E_{dp,3} - \psi_{qp,3} + X_{q2,3}I_{q,3}\right)
```
```math
\dot{E}_{dp,3} = \frac{1}{T_{qop,3}}\left(-E_{dp,3} + X_{qd,3}\psi_{qpp,3}\cdot k_{sat,3} + X_{q1,3} \left(I_{q,3} - X_{q3,3} \left(E_{dp,3} + I_{q,3}X_{q2,3} - \psi_{qp,3}\right)\right)\right)
```
Algebraic equations:
```math
V_{d,3} = -\psi_{qpp,3}(\psi_{qp^{\prime},3}E_{dp,3})(1+\omega_3)
```
```math
V_{q,3} = \psi_{dpp,3}(\psi_{dp^{\prime},3}E_{qp,3})(1+\omega_3)
```
```math
I_{d,3} = I_{G,3, r}\sin(\delta_3) - I_{G,3,i}\cos(\delta_3)
```
```math
I_{q,3} = I_{G,3, r}\cos(\delta_3) + I_{G,3,i}\sin(\delta_3)
```

Network interfaces:
```math
V_{d,3} = V_{3,r}\sin(\delta_3) - V_{3,i}\cos(\delta_3) + I_{d,3} R_{a,3} -I_{q,3} X_{qpp,3}
```
```math
V_{q,3} = V_{3,r}\cos(\delta_3) + V_{3,i} \sin(\delta_3) + I_{d,3}X_{qpp,3} + I_{q,3}R_{a,3}
```