-
Notifications
You must be signed in to change notification settings - Fork 4
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
Grid 3Bus Example for Phasor Dynamics #59
Draft
abdourahmanbarry
wants to merge
9
commits into
develop
Choose a base branch
from
abdou/phasor_dynamics
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+734
−0
Draft
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c78fb9e
Added README.md that describes 3Bus equations.
abdourahmanbarry 290ebd0
Update examples/Bus3Phasor/README.md
abdourahmanbarry 86b48eb
Update examples/Bus3Phasor/README.md
abdourahmanbarry 4888ce9
Added 3Bus diagram to README.md in Bus3Phasor folder
abdourahmanbarry a4c1d21
Indices r and i written before numerical indices
abdourahmanbarry 745d655
Added the diagram of the 3Bus example.
abdourahmanbarry 5a4619d
Added equations in the form f(t, y, y')=0 for the 3bus example
abdourahmanbarry 83a64a6
Added code for the residual of the DAE for the 3Bus example.
abdourahmanbarry 27f3c49
added residual function and testing
abdourahmanbarry File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,189 @@ | ||
|
||
<img src="genrou.png"> | ||
|
||
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,1},E_{dp,1})(1+\omega_1) | ||
``` | ||
```math | ||
V_{q,1} = \psi_{dpp,1}(\psi_{dp,1},E_{qp,1})(1+\omega_1) | ||
``` | ||
```math | ||
I_{d,1} = I_{G,r,1}\sin(\delta_1) - I_{G,i,1}\cos(\delta_1) | ||
``` | ||
```math | ||
I_{q,1} = I_{G,r,1}\cos(\delta_1) + I_{G,i,1}\sin(\delta_1) | ||
``` | ||
|
||
Network interfaces: | ||
```math | ||
V_{d,1} = V_{r,1}\sin(\delta_1) - V_{i,1}\cos(\delta_1) + I_{d,1} R_{a,1} -I_{q,1} X_{qpp,1} | ||
``` | ||
```math | ||
V_{q,1} = V_{r, 1}\cos(\delta_1) + V_{i,1}\sin(\delta_1) + I_{d,1}X_{qpp,1} + I_{q,1}R_{a,1} | ||
``` | ||
|
||
We can lump together the algebraic and network interface equations to get the following equivalent constraint equations: | ||
```math | ||
\left[\begin{array}{c} | ||
I_{d} \\ | ||
I_{q} | ||
\end{array}\right] = | ||
\left[\begin{array}{cr} | ||
\sin(\delta_1) & -\cos(\delta_1)\\ | ||
\cos(\delta_1) & \sin(\delta_1) | ||
\end{array}\right] | ||
\left[\begin{array}{c} | ||
I_{G,r,1} \\ | ||
I_{G,i,1} | ||
\end{array}\right] | ||
``` | ||
```math | ||
\left[\begin{array}{c} | ||
-\psi_{qpp,1}(\psi_{qp,1},E_{dp,1})(1+\omega_1) \\ | ||
\psi_{dpp,1}(\psi_{dp,1},E_{qp,1})(1+\omega_1) | ||
\end{array}\right] | ||
- \left[\begin{array}{cr} | ||
\sin(\delta_1) & -\cos(\delta_1)\\ | ||
\cos(\delta_1) & \sin(\delta_1) | ||
\end{array}\right] | ||
\left[\begin{array}{c} | ||
V_{r,1} \\ | ||
V_{i,1} | ||
\end{array}\right] | ||
= | ||
\left[\begin{array}{cr} | ||
R_a & -X_{qpp}\\ | ||
X_{qpp} & R_a | ||
\end{array}\right] | ||
\left[\begin{array}{c} | ||
I_{d} \\ | ||
I_{q} | ||
\end{array}\right] | ||
``` | ||
## 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,r,3}\sin(\delta_3) - I_{G,i,3}\cos(\delta_3) | ||
``` | ||
```math | ||
I_{q,3} = I_{G,r, 3}\cos(\delta_3) + I_{G,i,3}\sin(\delta_3) | ||
``` | ||
|
||
Network interfaces: | ||
```math | ||
V_{d,3} = V_{r,3}\sin(\delta_3) - V_{i,3}\cos(\delta_3) + I_{d,3} R_{a,3} -I_{q,3} X_{qpp,3} | ||
``` | ||
```math | ||
V_{q,3} = V_{r,3}\cos(\delta_3) + V_{i,3} \sin(\delta_3) + I_{d,3}X_{qpp,3} + I_{q,3}R_{a,3} | ||
``` | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generators may have their own labels that do not coincide with bus labels. For simplicity, in this case, you can switch bus 2 and 3 labels.