From 860d4932e7486ae232c50d64aeaca5765521e064 Mon Sep 17 00:00:00 2001 From: Reid Gomillion Date: Mon, 17 Feb 2025 17:53:26 -0500 Subject: [PATCH 1/3] Started README files for PowerElectronics + Examples --- examples/Microgrid/README.md | 7 ++ examples/ScaleMicrogrid/README.md | 15 ++++ .../DistributedGenerator/README.md | 74 +++++++++++++++++++ .../PowerElectronics/MicrogridBusDQ/README.md | 19 +++++ .../PowerElectronics/MicrogridLine/README.md | 30 ++++++++ .../PowerElectronics/MicrogridLoad/README.md | 27 +++++++ src/Model/PowerElectronics/README.md | 40 ++++++++++ 7 files changed, 212 insertions(+) create mode 100644 examples/Microgrid/README.md create mode 100644 examples/ScaleMicrogrid/README.md create mode 100644 src/Model/PowerElectronics/DistributedGenerator/README.md create mode 100644 src/Model/PowerElectronics/MicrogridBusDQ/README.md create mode 100644 src/Model/PowerElectronics/MicrogridLine/README.md create mode 100644 src/Model/PowerElectronics/MicrogridLoad/README.md create mode 100644 src/Model/PowerElectronics/README.md diff --git a/examples/Microgrid/README.md b/examples/Microgrid/README.md new file mode 100644 index 00000000..4696b410 --- /dev/null +++ b/examples/Microgrid/README.md @@ -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. \ No newline at end of file diff --git a/examples/ScaleMicrogrid/README.md b/examples/ScaleMicrogrid/README.md new file mode 100644 index 00000000..347ffe25 --- /dev/null +++ b/examples/ScaleMicrogrid/README.md @@ -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. + + Discrete 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. \ No newline at end of file diff --git a/src/Model/PowerElectronics/DistributedGenerator/README.md b/src/Model/PowerElectronics/DistributedGenerator/README.md new file mode 100644 index 00000000..5b4f32c2 --- /dev/null +++ b/src/Model/PowerElectronics/DistributedGenerator/README.md @@ -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. diff --git a/src/Model/PowerElectronics/MicrogridBusDQ/README.md b/src/Model/PowerElectronics/MicrogridBusDQ/README.md new file mode 100644 index 00000000..79432b0f --- /dev/null +++ b/src/Model/PowerElectronics/MicrogridBusDQ/README.md @@ -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. diff --git a/src/Model/PowerElectronics/MicrogridLine/README.md b/src/Model/PowerElectronics/MicrogridLine/README.md new file mode 100644 index 00000000..b7a7462d --- /dev/null +++ b/src/Model/PowerElectronics/MicrogridLine/README.md @@ -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. diff --git a/src/Model/PowerElectronics/MicrogridLoad/README.md b/src/Model/PowerElectronics/MicrogridLoad/README.md new file mode 100644 index 00000000..9c24bf0d --- /dev/null +++ b/src/Model/PowerElectronics/MicrogridLoad/README.md @@ -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. diff --git a/src/Model/PowerElectronics/README.md b/src/Model/PowerElectronics/README.md new file mode 100644 index 00000000..b23717a1 --- /dev/null +++ b/src/Model/PowerElectronics/README.md @@ -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). \ No newline at end of file From 9ea0a04fb341fd1b917f90c0cc13bdc003a81bf5 Mon Sep 17 00:00:00 2001 From: Reid Date: Tue, 25 Feb 2025 15:30:01 -0500 Subject: [PATCH 2/3] Update examples/ScaleMicrogrid/README.md Co-authored-by: pelesh --- examples/ScaleMicrogrid/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/ScaleMicrogrid/README.md b/examples/ScaleMicrogrid/README.md index 347ffe25..62beb494 100644 --- a/examples/ScaleMicrogrid/README.md +++ b/examples/ScaleMicrogrid/README.md @@ -1,7 +1,7 @@ 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. - + Discrete Generators : $2N$ + + Distributed Generators : $`2N`$ + Microgrid Lines : $2N-1$ + Microgrid Loads : $N$ + Microgrid Buses : $N$ From e664107173fffb7141db3f9be7d0f54dbe4ba197 Mon Sep 17 00:00:00 2001 From: Reid Date: Tue, 25 Feb 2025 15:30:09 -0500 Subject: [PATCH 3/3] Update examples/ScaleMicrogrid/README.md Co-authored-by: pelesh --- examples/ScaleMicrogrid/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/ScaleMicrogrid/README.md b/examples/ScaleMicrogrid/README.md index 62beb494..47564851 100644 --- a/examples/ScaleMicrogrid/README.md +++ b/examples/ScaleMicrogrid/README.md @@ -2,9 +2,9 @@ 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$ + + 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.