## Contents

- 1 Synopsis
- 2 Implementation
- 2.1 Sub-second Implementation (Dynamic)
- 2.1.1 Notation
- 2.1.2 Three-phase synchronous machine model
- 2.1.3 Network solution: initial static power flow and network solution during dynamic simulations
- 2.1.4 Interface between machine model and network solution
- 2.1.5 Synchronous machine controllers: governor and automatic voltage regulator
- 2.1.6 References

- 2.2 Super-second Implementation

- 2.1 Sub-second Implementation (Dynamic)
- 3 See also

# Synopsis

TODO:

Microgrids are useful

# Implementation

Implementation details

## Sub-second Implementation (Dynamic)

The GridLAB-D dynamic simulations represent electro-mechanic transients of unbalanced micro grid operation. The synchronous machines models are in fundamental frequency phasor representation considering unbalanced operation. The network and loads are represented with a full abc model. Additionally, diesel governor control and automatic voltage regulators are modeled. Figure 1 briefly presents the overall algorithm. Each model in the algorithm is explained in detail below.

### Notation

The following variables and parameters are used in the dynamic model equations below.

Variable | Definition |
---|---|

[math]\displaystyle{}i[/math] | Generator connected to bus i |

[math]\displaystyle{}E^\prime_{d,qi}[/math] | Transient voltages for direct and quadrature axis |

[math]\displaystyle{}E^{\prime\prime}_{d,qi}[/math] | Subtransient voltages for direct and quadrature axis |

[math]\displaystyle{}\psi_{1d,2qi}[/math] | Flux linkages of direct and quadrature axis dampers |

[math]\displaystyle{}T^\prime_{do,qoi}[/math] | Open circuit transient time constants for direct and quadrature axis |

[math]\displaystyle{}T^{\prime\prime}_{do,qoi}[/math] | Open circuit subtransient time constants for direct and quadrature axis |

[math]\displaystyle{}x^\prime_{d,qi}[/math] | Transient reactances for direct and quadrature axis |

[math]\displaystyle{}x^{\prime\prime}_{d,qi}[/math] | Subtransient reactances for direct and quadrature axis |

[math]\displaystyle{}x_{li}[/math] | Leakage reactance |

[math]\displaystyle{}R_{0,1,2i}[/math] | Zero, positive, and negative sequence resistances |

[math]\displaystyle{}I_{d,qi}[/math] | Currents for direct and quadrature axis |

[math]\displaystyle{}I_{0,1,2i}[/math] | Zero, positive, and negative sequence stator currents |

[math]\displaystyle{}E_{fd}[/math] | Field voltage |

[math]\displaystyle{}\omega_{i}[/math] | Rotor mechanical speed |

[math]\displaystyle{}\omega_{s}[/math] | Rated rotor mechanical speed |

[math]\displaystyle{}\delta_i[/math] | Rotor angular position |

[math]\displaystyle{}T_{mechi}[/math] | Mechanical torque |

[math]\displaystyle{}H_{i}[/math] | Inertia constant |

[math]\displaystyle{}D_{i}[/math] | Machine damping |

[math]\displaystyle{} \left[ E^{\prime\prime}_{a,b,c} \right] [/math] | Vector of internal machine subtransient voltages in abc coordinates |

[math]\displaystyle{} V_{a,b,c} [/math] | Network bus voltages in abc coordinates |

[math]\displaystyle{} I_{a,b,c} [/math] | Network bus current injections in abc coordinates |

[math]\displaystyle{} \left[ Jac \right] [/math] | Jacobian matrix of three-phase power flow solution |

[math]\displaystyle{} \left[ Y_{Ga,b,ci} \right] [/math] | Matrix of machine subtransient admittances in abc coordinates |

[math]\displaystyle{} Y_{G0,1,2i} [/math] | Machine subtransient admittances in symmetrical components coordinates |

[math]\displaystyle{} \left[ I_{GSa,b,ci} \right] [/math] | Vector of machine Norton current sources in abc coordinates |

[math]\displaystyle{} P_{T}, Q_{T} [/math] | Total terminal active and reactive generated power |

[math]\displaystyle{} I_{GS 0,1,2} [/math] | Machine Norton current sources in symmetrical component coordinates |

[math]\displaystyle{} \left[ V_{Ga,b,c} \right] [/math] | Vector of generator phase terminal voltages |

[math]\displaystyle{}V_{R}[/math] | Regulator voltage |

[math]\displaystyle{}V_{set}[/math] | Voltage setting of automatic voltage regulator (AVR) |

[math]\displaystyle{}V_{err}[/math] | Control error for AVR |

[math]\displaystyle{}x_{b}[/math] | State variable of AVR transient gain reduction |

[math]\displaystyle{}T_{B}[/math] | Time constant of AVR transient gain reduction |

[math]\displaystyle{}T_{C}[/math] | Time constant of AVR transient gain reduction |

[math]\displaystyle{}T_{A}[/math] | Exciter time constant |

[math]\displaystyle{}K_{A}[/math] | Exciter gain |

[math]\displaystyle{}E_{MAX,MIN}[/math] | Exciter limits |

[math]\displaystyle{}\omega_{set}[/math] | Governor speed setting |

[math]\displaystyle{}R [/math] | Governor droop |

[math]\displaystyle{}x_{1,2}[/math] | Governor electric control box state variables |

[math]\displaystyle{}T_{1,2,3}[/math] | Governor electric control box time constants |

[math]\displaystyle{}y_{gov}[/math] | Governor electric control box output |

[math]\displaystyle{}K [/math] | Governor actuator gain |

[math]\displaystyle{}x_{4,5,6}[/math] | Governor actuator state variables |

[math]\displaystyle{}T_{4,5,6}[/math] | Governor actuator time constants |

[math]\displaystyle{}y_{throttle}[/math] | Governor actuator output (throttle) |

### Three-phase synchronous machine model

Unbalanced operation of three phase synchronous machines is modeled using a simplified fundamental frequency model in phasor representation according to [1, 2, 3, 4]. This simplification allows representing the machine in symmetrical components where the positive sequence represents the main electrical torque, and the negative sequence current produces a torque in opposition. The total electrical torque is constant, facilitating the solution and determination of equilibrium. However, the variation of electrical torque due to unbalanced operation reported in [5, 6] is ignored. In addition, typical assumptions for transient stability models are also made: ignoring sub-transient saliency, and neglecting the stator dynamics [7].

The machine electrical dynamic equations are:

- [math]T^{\prime}_{doi} \frac{d E^{\prime}_{qi}}{dt}=E_{fd}- E^{\prime}_{qi}- (x_{di}-x^{\prime}_{di}) \left[I_{di}- \frac{(x^{\prime}_{di}-x^{\prime\prime}_{di})}{( x^{\prime}_{di}-x_{li})^2} \left[\psi_{1di}+ (x^{\prime}_{di}-x_{li}) I_{di}- E^{\prime}_{qi}\right] \right] [/math]

- [math] T^{\prime\prime}_{doi} \frac{d \psi_{1di}}{dt}=- \psi_{1di}+ E^{\prime}_{qi}- (x^{\prime}_{di}-x_{li}) I_{di} [/math]

- [math]T^{\prime}_{qoi} \frac{d E^{\prime}_{di}}{dt}=- E^{\prime}_{di}+ (x_{qi}-x^{\prime}_{qi}) \left[I_{qi}- \frac{(x^{\prime}_{qi}-x^{\prime\prime}_{qi})}{( x^{\prime}_{qi}-x_{li})^2} \left[\psi_{2qi}+ (x^{\prime}_{qi}-x_{li}) I_{qi}+ E^{\prime}_{di}\right] \right] [/math]

- [math] T^{\prime\prime}_{qoi} \frac{d \psi_{2qi}}{dt}=- \psi_{2qi}- E^{\prime}_{di}- (x^{\prime}_{qi}-x_{li}) I_{qi} [/math]

- [math] E^{\prime\prime}_{di}=- \frac{(x^{\prime\prime}_{qi}-x_{li})}{(x^{\prime}_{qi}-x_{li})} E^{\prime}_{di}+ \frac{(x^{\prime}_{qi}-x^{\prime\prime}_{qi})}{(x^{\prime}_{qi}-x_{li})} \psi_{2qi} [/math]
- [math] E^{\prime\prime}_{qi}= \frac{(x^{\prime\prime}_{di}-x_{li})}{(x^{\prime}_{di}-x_{li})} E^{\prime}_{qi}+ \frac{(x^{\prime}_{di}-x^{\prime\prime}_{di})}{(x^{\prime}_{di}-x_{li})} \psi_{1di} [/math]

The machine mechanical dynamic equations are:

- [math]\frac{d\delta_{i}}{dt}=\omega_{i}-\omega_{s}[/math]
- [math]\frac{2 H_{i}}{\omega_{s}} \frac{d\omega_{i}}{dt}=T_{mechi}- \frac{(x^{\prime\prime}_{qi}-x_{li})}{( x^{\prime}_{qi}-x_{li})} E^{\prime}_{di} I_{di}- \frac{(x^{\prime\prime}_{di}-x_{li})}{( x^{\prime}_{di}-x_{li})} E^{\prime}_{qi} I_{qi}- \frac{(x^{\prime}_{di}-x^{\prime\prime}_{di})}{( x^{\prime}_{di}-x_{li})} \psi_{1di} I_{qi}+ \frac{(x^{\prime}_{qi}-x^{\prime\prime}_{qi})}{( x^{\prime}_{qi}-x_{li})} \psi_{2qi} I_{di}- (x^{\prime\prime}_{qi}-x^{\prime\prime}_{di}) I_{di} I_{qi}- (R_{2i}-R_{si}) I_{2i}^2- D_{i}(\omega_{i}- \omega_{s}) [/math]

### Network solution: initial static power flow and network solution during dynamic simulations

The network and loads are represented in full abc coordinates. The abc representation allows a complete representation of line and load unbalances. The network solution is anextension the method proposed in [8].

To adequately initialize the dynamic simulation, the static power flow solution of three-phase synchronous generator buses should consider the symmetry built features of generators. In other words the phase voltage and power unbalance of the generator buses cannot be freely determined. Even though the phase powers and voltages can be still unbalanced, they are subject to a generator symmetry built constraint. The symmetry built constraint was first introduced in [9] for PQ generator buses in a distribution network power flow solution. In [10], the symmetry built constraint is also applied to slack and PV buses, allowing for an adequate initialization of dynamic simulation from the static power flow solution. The symmetry constraints are applied to the initial static power flow as follows.

The following equations describe the network solution model in compact form, for more details see [8].

- [math] \left[ \Delta I_{a,b,c} \right] = \left[ Jac \right] \left[ \Delta V_{a,b,c} \right][/math]

Where the matrix [math] \left[ Jac \right] [/math] is equal to the bus admittance matrix, except for the diagonal elements that have additional terms to represent ZIP loads [8]. The full generator admittances are incorporated to the bus admittance matrices to represent the machine characteristics. The generator admittance matrices are, according to [9]:

- [math] \left[ Y_{Ga,b,ci} \right] = \frac{1}{3} \begin{bmatrix} 1 & 1 & 1 \\ 1 & e^{j 4\pi /3} & e^{j 2\pi /3} \\ 1 & e^{j 2\pi /3} & e^{j 4\pi /3} \\ \end{bmatrix} \begin{bmatrix} Y_{G0i} & 0 & 0 \\ 0 & Y_{G1i} & 0 \\ 0 & 0 & Y_{G2i} \\ \end{bmatrix} \begin{bmatrix} 1 & 1 & 1 \\ 1 & e^{j 2\pi /3} & e^{j 4\pi /3} \\ 1 & e^{j 4\pi /3} & e^{j 2\pi /3} \\ \end{bmatrix} [/math]

The symmetry constraint applied to generator buses in the initial static power flow solution is given by [9]:

- [math] I_{GS1}= \frac{P_{T}+jQ_{T} + \left[ V_{Ga,b,c} \right]^{*T} \left[ Y_{Ga,b,ci} \right] \left[ V_{Ga,b,ci} \right]} {V_{Ga}^{*}+ e^{j 4\pi /3} V_{Gb}^{*}+ e^{j 2\pi /3} V_{Gc}^{*}} [/math]
- [math] \left[ I_{GSa,b,ci} \right] = \frac{1}{3} \begin{bmatrix} 1 \\ e^{j 4\pi /3} \\ e^{j 2\pi /3} \\ \end{bmatrix} I_{GS1} [/math]

Due to generator symmetry built, there are no negative and zero sequence current sources [9]:

- [math]\displaystyle{} I_{GS0}= I_{GS2}=0 [/math]

The symmetry built constraint was applied to PQ generator buses in [9]. The application to Slack and PV generator buses in a micro grid setting is reported in [10]. The symmetry constraint is no longer applied during the dynamic simulations, where the symmetric generator’s current source injection depend on the dynamic states as explained in the following point.

### Interface between machine model and network solution

The synchronous machine dynamic models are linked to the network solution by using Norton current source equivalents with shunt generator impedances, as suggested in [9, 11]. The current sources are symmetric balanced current injections to respect the generator symmetry built (windings symmetrically distributed in stator and rotor), and the generator impedances account for the effect of unbalanced terminal voltages. It is important to notice that the total generator current (current source minus current derived through generator shunt impedance) can also be unbalanced. The interface is formulated as:

- [math] \left[ I_{GSa,b,ci} \right]= \left[ E^{\prime\prime}_{a,b,c} \right] \left[ Y_{Ga,b,ci} \right] [/math]

Where [math]\left[ E^{\prime\prime}_{a,b,c} \right] [/math] is a balanced voltage calculated by transforming [math] E^{\prime\prime}_{di} [/math] and [math] E^{\prime\prime}_{qi} [/math] to network reference frame and then to abc reference frame.

### Synchronous machine controllers: governor and automatic voltage regulator

Generator control models are also defined in the GridLAB-D dynamic simulations. The generator control models are:

- Woodward diesel governor (DEGOV1) that modifies the mechanical power of the diesel generator proportionally to the generator speed deviation
- Simplified exciter system (SEXS) that modifies the generator field voltage (and hence its reactive power) to control the generator^\prime s terminal voltage (average voltage magnitude of all phases)

DEGOV1 and SEXS models are commonly used in power system industry-grade transient stability programs such as GE PSLF and PSS/E.Block diagrams for DEGOV1 and SEXS can be found at: http://www.powerworld.com/files/Block-Diagrams-16.pdf. DEGOV1 is on page 123 and SEXS is on page 88.

The simplified exciter system (SEXS) equations are:

- [math] V_{err} = V_{set}- average \left( |\left[ V_{Ga,b,c} \right] | \right)[/math]
- [math] T_{B} \frac{d x_{b}}{dt} = V_{err}- x_{b} [/math]
- [math] V_{R}= x_{b}+ T_{C} \frac{d x_{b}}{dt} [/math]
- [math] T_{A} \frac{d E_{fd}}{dt} = K_{A} V_{R}- E_{fd} [/math]
- [math] E_{MIN} \leq E_{fd} \leq E_{MAX} [/math]

The diesel governor DGOV1 equations are:

- Electric control box

- [math] T_{1} T_{2} \frac{d x_{2}}{dt} = \omega_{set}- \omega_{i}- R \cdot y_{throttle}- x_{1}- x_{2} [/math]
- [math] \frac{d x_{1}}{dt} = x_{2} [/math]
- [math]\displaystyle{} y_{gov} = T_{3} x_{2}+ x_{1} [/math]

- Actuator

- [math] T_{5} \frac{d x_{5}}{dt} = K \cdot y_{gov}- x_{5} [/math]
- [math] T_{6} \frac{d x_{6}}{dt} = x_{5}- x_{6} [/math]
- [math] \frac{d x_{4}}{dt} = x_{6} [/math]
- [math] T_{MIN} \leq x_{4} \leq T_{MAX} [/math]
- [math]\displaystyle{} y_{throttle}= T_{4} x_{6}+ x_{4} [/math]

- Diesel engine

- [math] T_{mechi} = delay \left( y_{t}, T_{D} \right) [/math]

### References

- Kundur, P. “Power system stability and control” New York: McGraw-hill, 1994.
- Harley, R. G., E. B. Makram, and E. G. Duran. "The effects of unbalanced networks on synchronous and asynchronous machine transient stability." Electric power systems research 13, no. 2 (1987): 119-127.
- Makram, E. B., V. O. Zambrano, and R. G. Harley. "Synchronous generator stability due to multiple faults on unbalanced power systems." Electric power systems research 15, no. 1 (1988): 31-39.
- Makram, E. B., V. O. Zambrano, R. G. Harley, and Juan C. Balda. "Three-phase modeling for transient stability of large scale unbalanced distribution systems." Power Systems, IEEE Transactions on 4, no. 2 (1989): 487-493.
- Salim, R. H., and R. A. Ramos. "A Model-Based Approach for Small-Signal Stability Assessment of Unbalanced Power Systems." IEEE Transactions on Power Systems, November 2012.
- Krause, P., O. Wasynczuk, and S. Scott. "Analysis of electric machinery." IEEE Power Eng. Soc 15, no. 3 (1995).
- Kundur, P., and P. L. Dandeno. "Implementation of advanced generator models into power system stability programs." Power Apparatus and Systems, IEEE Transactions on 7 (1983): 2047-2054.
- Garcia, Paulo AN, Jose Luiz R. Pereira, Sandoval Carneiro Jr, Vander M. da Costa, and Nelson Martins. "Three-phase power flow calculations using the current injection method." Power Systems, IEEE Transactions on 15, no. 2 (2000): 508-514.
- Chen, T-H., M-S. Chen, Toshio Inoue, Paul Kotas, and Elie A. Chebli. "Three-phase cogenerator and transformer models for distribution system analysis." Power Delivery, IEEE Transactions on 6, no. 4 (1991): 1671-1681.
- Elizondo M, F Tuffner, K Schneider, “Network solution for initialization and simulation of transient stability model of unbalanced microgrid,” to be submitted
- Stott, B.. "Power system dynamic response calculations." Proceedings of the IEEE 67, no. 2 (1979): 219-241.

## Super-second Implementation

Super-second implementation details will go here - AVR and Drooping