-
Notifications
You must be signed in to change notification settings - Fork 4
Improving Documentation of Microgrid and Components #60
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
Draft
reid-g
wants to merge
3
commits into
develop
Choose a base branch
from
reid/microgrid_docs
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.
Draft
Changes from all commits
Commits
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 hidden or 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,7 @@ | ||
|
||
|
||
The model is formed from the example provided in Figure 1 of reference 1. Composed with equations derived from both 1 & 2. Parameters are given by Table 1 in reference 1. Reference solution is generated from MATLAB code implementation with tight tolerances. Utilizes the PowerElectronicsModel composer framework. | ||
|
||
|
||
1. Pogaku, Nagaraju, Milan Prodanovic, and Timothy C. Green. "Modeling, analysis and testing of autonomous operation of an inverter-based microgrid." IEEE Transactions on power electronics 22.2 (2007): 613-625. | ||
2. Bidram, Ali, Frank L. Lewis, and Ali Davoudi. "Distributed control systems for small-scale power networks: Using multiagent cooperative control theory." IEEE Control systems magazine 34.6 (2014): 56-77. |
This file contains hidden or 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,15 @@ | ||
|
||
|
||
The model is an expanded form of the model in reference 1 and 2. Utilizes the PowerElectronicsModel composer framework. Given a free parameter $N \ge 1$ then the amount of components the system have are as follows. | ||
+ Distributed Generators : $`2N`$ | ||
+ Microgrid Lines : $`2N-1`$ | ||
+ Microgrid Loads : $`N`$ | ||
+ Microgrid Buses : $`N`$ | ||
|
||
When $N=2$ the original case in reference 1 is constructed. | ||
All parameters are given by duplicating the parameters in reference 1 over the extended system. The system extends by connecting new systems over the even indexed buses. | ||
Reference solutions are provided for the cases of when $N=\{2, 4, 8\}$. These are generated from a MATLAB based code with tight tolerances. | ||
|
||
|
||
1. Pogaku, Nagaraju, Milan Prodanovic, and Timothy C. Green. "Modeling, analysis and testing of autonomous operation of an inverter-based microgrid." IEEE Transactions on power electronics 22.2 (2007): 613-625. | ||
2. Bidram, Ali, Frank L. Lewis, and Ali Davoudi. "Distributed control systems for small-scale power networks: Using multiagent cooperative control theory." IEEE Control systems magazine 34.6 (2014): 56-77. |
This file contains hidden or 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,74 @@ | ||
|
||
The Distributed Generator Component found in references 1 and 2. | ||
|
||
Parameters: | ||
+ $\omega_b$ - Reference Rotating Frame | ||
+ $\omega_c$ - Cutoff Frequency | ||
+ $m_p$ - Drop Gain, Frequency Range | ||
+ $V_n$ - Nominal Set Point of D-Axis Output Voltage | ||
+ $n_q$ - Voltage Range | ||
+ $F$ - PI Controller Parameter in 1 & 2 | ||
+ $K_{pv}$ - PI Controller Parameter in 1 & 2 | ||
+ $K_{iv}$ - PI Controller Parameter in 1 & 2 | ||
+ $K_{pc}$ - PI Controller Parameter in 1 & 2 | ||
+ $C_f$ - Shunt?? | ||
+ $r_{Lf}$ - Resistance of line f | ||
+ $L_{f}$ - Inductance of line f | ||
+ $r_{Lc}$ - Resistance of line c | ||
+ $L_{c}$ - Inductance of line c | ||
|
||
Variables (External): | ||
+ $\omega_{ref}$ - Network reference $\omega$ | ||
+ $V_{a}$ - Incoming Bus Voltage (a) | ||
+ $V_{b}$ - Incoming Bus Voltage (b) | ||
|
||
Variables (Internal): | ||
+ $\delta$ - Rotor difference from reference | ||
+ $\omega$ - Frequency | ||
+ $P$ - Real Power | ||
+ $Q$ - Reactive Power | ||
+ $\phi_{d}$ - Output Voltage Control PI Variable | ||
+ $\phi_{q}$ - Output Voltage Control PI Variable | ||
+ $\gamma_{d}$ - Output Current Control PI Variable | ||
+ $\gamma_{q}$ - Output Current Control PI Variable | ||
+ $i_{ld}$ - Current of Line l (dq-space) | ||
+ $i_{lq}$ - Current of Line l (dq-space) | ||
+ $v_{od}$ - Voltage of Bus o (dq-space) | ||
+ $v_{oq}$ - Voltage of Bus o (dq-space) | ||
+ $i_{od}$ - Current of Line o (dq-space) | ||
+ $i_{oq}$ - Current of Line o (dq-space) | ||
|
||
Equations (External, Residuals): | ||
+ $\omega_{com} - \omega$    (If this generator is considered the reference one, otherwise 0) | ||
+ $\cos(\delta) i_{od} - \sin(\delta) i_{oq}$ | ||
+ $\sin(\delta) i_{od} + \cos(\delta) i_{oq}$ | ||
|
||
Equations (Internal): | ||
+ $\omega_{com} = \omega_{b} - m_{p} P$ | ||
+ $\frac{d\delta}{dt} = \omega_{com} - \omega$ | ||
+ $\frac{dP}{dt} = \omega_c ( v_{od} i_{od} + v_{oq} i_{oq} - P)$ | ||
+ $\frac{dQ}{dt} = \omega_c ( v_{od} i_{oq} + v_{oq} i_{od} - Q)$ | ||
+ $v_{od}^* = V_{n} - n_q Q$ | ||
+ $v_{oq}^* = 0$ | ||
+ $\frac{d\phi_{d}}{dt} = v_{od}^* - v_{od}$ | ||
+ $\frac{d\phi_{q}}{dt} = v_{oq}^* - v_{oq}$ | ||
+ $i_{ld}^* = F i_{od} - \omega_{b} C_{f} v_{oq} + K_{pv} (v_{od}^* - v_{od}) + K_{iv} \phi_{d}$ | ||
+ $i_{lq}^* = F i_{oq} - \omega_{b} C_{f} v_{od} + K_{pv} (v_{oq}^* - v_{oq}) + K_{iv} \phi_{q}$ | ||
+ $\frac{d\gamma_{d}}{dt} = i_{ld}^* - i_{ld}$ | ||
+ $\frac{d\gamma_{q}}{dt} = i_{lq}^* - i_{lq}$ | ||
+ $v_{id}^* = -\omega_{b} L_{f} i_{lq} + K_{pc} ( i_{ld}^* - i_{ld}) + K_{ic} \gamma_{d}$ | ||
+ $v_{iq}^* = -\omega_{b} L_{f} i_{ld} + K_{pc} ( i_{lq}^* - i_{lq}) + K_{ic} \gamma_{q}$ | ||
+ $\frac{di_{ld}}{dt} = -(\frac{r_{Lf}}{L_{f}}) i_{ld} + \omega_{com} i_{lq} + \frac{v_{id}^* - v_{id}}{L_f}$ | ||
+ $\frac{di_{lq}}{dt} = -(\frac{r_{Lf}}{L_{f}}) i_{lq} + \omega_{com} i_{ld} + \frac{v_{iq}^* - v_{iq}}{L_f}$ | ||
+ $\frac{dv_{od}}{dt} = \omega_{com} v_{oq} + \frac{i_{ld} - i_{od}}{C_f}$ | ||
+ $\frac{dv_{oq}}{dt} = -\omega_{com} v_{od} + \frac{i_{lq} - i_{oq}}{C_f}$ | ||
+ $V_{bd,in} = \cos(\delta) V_{a} - \sin(\delta) V_{b}$ | ||
+ $V_{bq,in} = -\sin(\delta) V_{a} + \cos(\delta) V_{b}$ | ||
+ $\frac{di_{od}}{dt} = -(\frac{r_{Lc}}{L_{c}}) i_{od} + \omega_{com} i_{oq} + \frac{v_{od} - V_{bd,in}}{L_f}$ | ||
+ $\frac{di_{oq}}{dt} = -(\frac{r_{Lc}}{L_{c}}) i_{oq} + \omega_{com} i_{ld} + \frac{v_{oq} - V_{bq,in}}{L_f}$ | ||
|
||
Note all internal direct equalities are simplified into the differential equations. | ||
|
||
|
||
1. Pogaku, Nagaraju, Milan Prodanovic, and Timothy C. Green. "Modeling, analysis and testing of autonomous operation of an inverter-based microgrid." IEEE Transactions on power electronics 22.2 (2007): 613-625. | ||
2. Bidram, Ali, Frank L. Lewis, and Ali Davoudi. "Distributed control systems for small-scale power networks: Using multiagent cooperative control theory." IEEE Control systems magazine 34.6 (2014): 56-77. |
This file contains hidden or 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,19 @@ | ||
|
||
The Bus used for the Microgrid found in references 1 and 2. | ||
|
||
Parameters: | ||
+ $RN$ - Virtual Resistance | ||
|
||
Variables (External): | ||
+ $v_{D}$ - Incoming Bus Voltage (D) | ||
+ $v_{Q}$ - Incoming Bus Voltage (Q) | ||
|
||
Equations (External, Residuals): | ||
+ $\frac{-v_D}{RN}$ | ||
+ $\frac{-v_Q}{RN}$ | ||
|
||
There are no internal variables to this system. Only residuals to be added from existing externals. As $RN \rightarrow \infty$ then the bus represent Kirchhoff's current law. | ||
|
||
|
||
1. Pogaku, Nagaraju, Milan Prodanovic, and Timothy C. Green. "Modeling, analysis and testing of autonomous operation of an inverter-based microgrid." IEEE Transactions on power electronics 22.2 (2007): 613-625. | ||
2. Bidram, Ali, Frank L. Lewis, and Ali Davoudi. "Distributed control systems for small-scale power networks: Using multiagent cooperative control theory." IEEE Control systems magazine 34.6 (2014): 56-77. |
This file contains hidden or 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,30 @@ | ||
|
||
The Line used for the Microgrid found in references 1 and 2. | ||
|
||
Parameters: | ||
+ $R$ - Resistance | ||
+ $L$ - Inductance | ||
|
||
Variables (External): | ||
+ $\omega_{ref}$ - Reference Rotor Angle | ||
+ $v_{D1}$ - Incoming Bus 1 Voltage (D) | ||
+ $v_{Q1}$ - Incoming Bus 1 Voltage (Q) | ||
+ $v_{D2}$ - Incoming Bus 2 Voltage (D) | ||
+ $v_{Q2}$ - Incoming Bus 2 Voltage (Q) | ||
+ $i_{D}$ - Line Current (D) | ||
+ $i_{Q}$ - Line Current (Q) | ||
|
||
Equations (External, Residuals): | ||
+ $0$    (Reference Rotor Residual) | ||
+ $-i_{D}$    (Bus 1 Residuals) | ||
+ $-i_{Q}$ | ||
+ $i_{D}$    (Bus 2 Residuals) | ||
+ $i_{Q}$ | ||
|
||
Equations (Internal): | ||
+ $\frac{di_{D}}{dt} = -(\frac{R}{L}) i_{D} + \omega_{ref} i_{Q} + \frac{v_{D1} - v_{D2}}{L}$ | ||
+ $\frac{di_{Q}}{dt} = -(\frac{R}{L}) i_{Q} + \omega_{ref} i_{D} + \frac{v_{Q1} - v_{Q2}}{L}$ | ||
|
||
|
||
1. Pogaku, Nagaraju, Milan Prodanovic, and Timothy C. Green. "Modeling, analysis and testing of autonomous operation of an inverter-based microgrid." IEEE Transactions on power electronics 22.2 (2007): 613-625. | ||
2. Bidram, Ali, Frank L. Lewis, and Ali Davoudi. "Distributed control systems for small-scale power networks: Using multiagent cooperative control theory." IEEE Control systems magazine 34.6 (2014): 56-77. |
This file contains hidden or 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,27 @@ | ||
|
||
The Load used for the Microgrid found in references 1 and 2. | ||
|
||
Parameters: | ||
+ $R$ - Resistance | ||
+ $L$ - Inductance | ||
|
||
Variables (External): | ||
+ $\omega_{ref}$ - Reference Rotor Angle | ||
+ $v_{D}$ - Incoming Bus Voltage (D) | ||
+ $v_{Q}$ - Incoming Bus Voltage (Q) | ||
+ $i_{D}$ - Line Current (D) | ||
+ $i_{Q}$ - Line Current (Q) | ||
|
||
Equations (External, Residuals): | ||
+ $0$    (Reference Rotor Residual) | ||
+ $-i_{D}$    (Bus Residuals) | ||
+ $-i_{Q}$ | ||
|
||
Equations (Internal): | ||
+ $\frac{di_{D}}{dt} = -(\frac{R}{L}) i_{D} + \omega_{ref} i_{Q} + \frac{v_{D1} - v_{D2}}{L}$ | ||
+ $\frac{di_{Q}}{dt} = -(\frac{R}{L}) i_{Q} + \omega_{ref} i_{D} + \frac{v_{Q1} - v_{Q2}}{L}$ | ||
|
||
|
||
|
||
1. Pogaku, Nagaraju, Milan Prodanovic, and Timothy C. Green. "Modeling, analysis and testing of autonomous operation of an inverter-based microgrid." IEEE Transactions on power electronics 22.2 (2007): 613-625. | ||
2. Bidram, Ali, Frank L. Lewis, and Ali Davoudi. "Distributed control systems for small-scale power networks: Using multiagent cooperative control theory." IEEE Control systems magazine 34.6 (2014): 56-77. |
This file contains hidden or 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,40 @@ | ||
This sub-directory provides components utilized within the PowerElectronicsModel composer. All components are treated equally and only the composer can view and distribute data to components. Components have no knowledge nor require the existence of any other component. | ||
Each component evaluates a set of equations to form residuals. There are two types of variables. | ||
+ Internal Variables. Variables only need by the component. | ||
+ External Variables. Variables shared between multiple components. | ||
|
||
Each equation is associated to a variable. The residuals generated by external components are assumed to add together to form the final system. | ||
Arbitrary amounts of components can be handle and residuals evaluated. | ||
|
||
The composer can handle arbitrary components with arbitrary connections. | ||
Connections are handled via integer mapping between components and the composer via `getNodeConnections` and `setNodeConnections`. | ||
|
||
The composer suppose Jacobian constructions as well. | ||
|
||
Example with two components is as follows. | ||
|
||
Component 1: | ||
```math | ||
\begin{align} | ||
0 = f_1(\frac{dy_{1}}{dt}, y_1 ,z) & \qquad \text{(Internal Equations)}\\ | ||
c_1(y_1,z) & \qquad \text{(External Residuals)}\\ | ||
\end{align} | ||
``` | ||
Component 2: | ||
```math | ||
\begin{align} | ||
0 = f_2(\frac{dy_{2}}{dt}, y_2 ,z) & \qquad \text{(Internal Equations)}\\ | ||
c_2(y_2,z) & \qquad \text{(External Residuals)}\\ | ||
\end{align} | ||
``` | ||
|
||
The composition of components 1 and 2: | ||
```math | ||
\begin{align} | ||
0 = f_1(\frac{dy_{1}}{dt}, y_1 ,z) & \qquad \text{(Internal Equations)}\\ | ||
0 = f_2(\frac{dy_{2}}{dt}, y_2 ,z) &\\ | ||
0 = c_1(y_1, z) + c_2(y_2,z) & \qquad \text{(Composed External Residuals)}\\ | ||
\end{align} | ||
``` | ||
|
||
Note the dimensions of \(y\) can be \(0\) if there are no internal equations (an example seen in Resistors and MicrogridBus). |
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.
Did you mean to say that all algebraic constraints are eliminated by substituting them into differential equations?
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.
Was trying to be more specific. When I think of algebraic constraints its$0=g(y,z)$ where z is non-trivial to get. This case is trivial since $0=G(y)-z$ so are typically simplified out. So "direct equalities" seemed reasonable terminology.
However, re-reading it sounds weird so maybe something different is needed.