Node Types

The currently implemented node types are

Detailed Node Type Documentation

PowerDynamics.CSIMinimalType
CSIMinimal(;I_r)

A node type that keeps the current fixed as a desired values I_r.

CSIMinimal models an inverters as an ideal current source. This can be the most simple representation of an inverter in grid-feeding mode, according to Rocabert, Joan, et al. "Control of power converters in AC microgrids." (2012). Here, additionally to u, there are no internal dynamic variables.

Keyword Arguments

  • I_r: reference/ desired current

Mathematical Representation

Using CSIMinimal for node $a$ gives:

\[0 = I_{r,a} - \left\|i_a\right\|\]

source
PowerDynamics.ExponentialRecoveryLoadType
ExponentialRecoveryLoad(P0, Q0, Nps, Npt, Nqs, Nqt, Tp, Tq, V0)

A node type that represents the exponential recovery load model. The exponential recovery load model aims to capture the load restoration characteristics with an exponential recovery process expressed as an input–output relationship between powers (real and reactive) and voltage.

Keyword Arguments

  • P0: Active power load demand [pu]
  • Q0: Reactive power load demand [pu]
  • Nps: Steady-state load voltage dependence p-axis [pu]
  • Npt: Transient load voltage dependence p-axis [pu]
  • Nqs: Steady-state load voltage dependence q-axis [pu]
  • Nqt: Transient load voltage dependence q-axis [ pu]
  • Tp: Load recovery constant p-axis [s]
  • Tq: Load recovery constant q-axis [s]
  • V0: Reference grid voltage [pu]

Mathematical Representation

\[ \dfrac{dx_p}{dt} = \dfrac{1}{T_p}(-x_p + P_0(\dfrac{|u|}{V_0})^{N_{ps}} - P_0(\dfrac{|u|}{V_0})^{N_{pt}}) \\ \dfrac{dx_q}{dt} = \dfrac{1}{T_q}(-x_q + Q_0(\dfrac{|u|}{V_0})^{N_{qs}} - Q_0(\dfrac{|u|}{V_0})^{N_{qt}}) \\ P = x_p + P_0(\dfrac{|u|}{V_0})^{N_{pt}} \\ Q = x_q - Q_0(\dfrac{|u|}{V_0})^{N_{qt}} \\\]

IEEE TRANSACTIONS ON POWER SYSTEMS, VOL. 21, NO. 3, AUGUST 2006 Measurement-Based Dynamic Load Models: Derivation, Comparison, and Validation Byoung-Kon Choi, Member, IEEE, Hsiao-Dong Chiang, Fellow, IEEE, Yinhong Li, Hua Li, Member, IEEE, Yung-Tien Chen, Der-Hua Huang, and Mark G. Lauby

source
PowerDynamics.FourthOrderEqType
FourthEq(H, P, D, Ω, E_f, T_d_dash ,T_q_dash ,X_q_dash ,X_d_dash,X_d, X_q)

A node type that applies the 4th-order synchronous machine model with frequency/angle and voltage dynamics, which is implemented according to P. Sauer, "Power System Dynamics and Stability". For an illustration of a synchronous machine schematic see P. Sauer, Fig. 3.1 on p. 25.

Usually the swing equation (SwingEq) is used for short time periods to analyze the transient behavior of generators in a power grid, the so-called first swing. The 4th-order model also takes the back reaction of the power flow onto the voltage into account. This has the effect that the angle of the voltage as seen by the power grid, and the angle of the rotating mass are no longer the same but become dynamically coupled.

Additionally to $u$, it has the internal dynamic variables

  • $ω$ representing the frequency of the rotator relative to the grid frequency $Ω$, i.e. the real frequency $ω_r$ of the rotator is given as $\omega_r = \Omega + \omega$ and
  • $θ$ representing the relative angle of the rotor with respect to the voltage angle $ϕ$.

Keyword Arguments

  • H: shaft inertia constant (given in [s]), defined according to P. Sauer, p. 33, eq. (3.60)
  • P: active (real) power output, also called the mechanical torque applied to the shaft, given in [pu]
  • D: damping coefficient (given in [s], see P. Sauer, eq. (5.156) where the damping torque is equal )
  • Ω: rated frequency of the power grid, often $2π⋅50Hz$
  • T_d_dash: time constant of d-axis, given in [s], see P. Sauer, chapter 3.7, p. 54 for a general explanation on time constants
  • T_q_dash: time constant of q-axis, given in [s]
  • X_d_dash: transient reactance of d-axis, given in [pu]
  • X_q_dash: transient reactance of q-axis, given in [pu]
  • X_d: reactance of d-, given in [pu]
  • X_d: reactance of q-axis, given in [pu]
  • E_f: scaled field voltage, which, if set equal to 1.0 pu, gives 1.0 pu open-circuit terminal voltage. The physical device that provides the value of E_f is called the exciter (according to P. Sauer, p. 65)

Mathematical Representation

Using FourthEq for node $a$ applies the equations

\[ u = -je_c e^{j\theta} = -j(e_d + je_q)e^{j\theta}\\ e_c= e_d + je_q = jue^{-j\theta}\\ i = -ji'e^{j\theta} = -j(i_d+ j i_q )e^{j\theta} = Y^L \cdot u \\ i_c= i_d + ji_q = jie^{-j\theta}\\ p = \Re (i^* u)\]

where complex voltage and current are described in a co-rotating frame with axes labeled d and q.

The fourth-order equations read (according to P. Sauer, "Power System Dynamics and Stability", p. 140, eqs. (6110)-(6114)) and p. 35 eqs(3.90)-(3.91)

\[ \frac{d\theta}{dt} = \omega \\ \frac{d\omega}{dt} = (P-D\omega - p -(X'_q-X'_d)i_d i_q)Ω_H\\ \frac{d e_q}{dt} = \frac{1}{T'_d} (- e_q - (X_d - X'_d) i_{d}+ E_f) \\ \frac{d e_d}{dt} = \frac{1}{T'_q} (- e_d + (X_q - X'_q) i_{q}) \\\]

The equations for frequency and phase represent energy conservation and phase shift. The dynamic equations for the complex voltage show the relationship between the dynamicy of flux linkages and currents which must reflect a conservative coupling field.

With the PowerDynamics.jl naming conventions of $i$ and $u$ they read as

\[ \dot u = \frac{d}{dt}(-j e_c e^{j\theta})=-j(\dot e_d + j\dot e_q)e^{j\theta} + uj\omega\]

source
PowerDynamics.FourthOrderEqExciterIEEEDC1AType

A node type that applies the 4th-order synchronous machine model with frequency/angle and voltage dynamics, which is implemented according to P. Sauer, "Power System Dynamics and Stability". For an illustration of a synchronous machine schematic see P. Sauer, Fig. 3.1 on p. 25. Usually the swing equation (SwingEq) is used for short time periods to analyze the transient behavior of generators in a power grid, the so-called first swing. The 4th-order model also takes the back reaction of the power flow onto the voltage into account. This has the effect that the angle of the voltage as seen by the power grid, and the angle of the rotating mass are no longer the same but become dynamically coupled.

In addition to the 4th-order model the Type IEEEDC1A exciter was implemented. The type was implemented using the following resources as the guide line: "MatDyn" Copyright ©2009 Stijn Cole and "IEEE Recommended Practice for Excitation System Models for Power System Stability Studies", IEEE Power and Energy Society, 2016

Additionally to $u$, it has the internal dynamic variables

  • $ω$ representing the frequency of the rotator relative to the grid frequency $Ω$, i.e. the real frequency $ω_r$ of the rotator is given as $\omega_r = \Omega + \omega$
  • $θ$ representing the relative angle of the rotor with respect to the voltage angle $ϕ$.
  • $E_f$ representing the scaled field voltage, The exciter model (here IEEEDC1A) provides the value for $E_f$(according to P. Sauer, p. 65)
  • $U_r$ representing the Voltage regulator output in [pu]
  • $U_f$ representing the excitation system stabilization rate feedback

Keyword Arguments

  • H: shaft inertia constant (given in [s]), defined according to P. Sauer, p. 33, eq. (3.60)
  • P: active (real) power output, also called the mechanical torque applied to the shaft, given in [pu]
  • D: damping coefficient (given in [s], see P. Sauer, eq. (5.156) where the damping torque is equal )
  • Ω: rated frequency of the power grid, often $2π⋅50Hz$
  • T_d_dash: time constant of d-axis, given in [s], see P. Sauer, chapter 3.7, p. 54 for a general explanation on time constants
  • T_q_dash: time constant of q-axis, given in [s]
  • X_d_dash: transient reactance of d-axis, given in [pu]
  • X_q_dash: transient reactance of q-axis, given in [pu]
  • X_d: reactance of d-, given in [pu]
  • X_d: reactance of q-axis, given in [pu]

IEEE DC1A Exciter Model

  • K_e: Exciter constant related to self-excited field [pu]
  • K_f: Excitation control system stabilizer gains [pu]
  • K_a: Voltage Regulator gain [pu]
  • U:
  • U_ref: Reference value of the stator terminal voltage [pu]
  • U_ref2: Reference value of the stator terminal voltage [pu]
  • U_rmax: Voltage regulator maximum output [pu]
  • U_rmin: Voltage regulator minimum output [pu]
  • T_a: Time constant of the voltage regulator [s]
  • T_f: Excitation control system stabilizer time constant [s]
  • T_e: Exciter time constant, integration rate associated with exciter control [s]

The fourth-order equations read (according to P. Sauer, "Power System Dynamics and Stability", p. 140, eqs. (6110)-(6114)) and p. 35 eqs(3.90)-(3.91)

\[ \frac{d\theta}{dt} = \omega \\ \frac{d\omega}{dt} = (P-D\omega - p -(X'_q-X'_d)i_d i_q)Ω_H\\ \frac{d e_q}{dt} = \frac{1}{T'_d} (- e_q - (X_d - X'_d) i_{d}+ E_f) \\ \frac{d e_d}{dt} = \frac{1}{T'_q} (- e_d + (X_q - X'_q) i_{q}) \\\]

The IEEE DC1A Exciter Model applies the following equations:

\[ U_x = A_x \cdot e^{(B_x \cdot E_f)} \\ dU_r = \frac{1}{T_a} \cdot (K_a \cdot (U_{ref} - U + U_{ref2} - U_f) - U_r)\\ dU_f = \frac{1}{T_f} \cdot (\frac{K_f}{T_e} \cdot (U_r - U_x - K_e \cdot E_f) - U_f) U_{r2} = \begin{cases} U_{rmax} & \text{if } U_{r} > U_{rmax} \\ U_{rmin} & \text{if } U_{r} < U_{rmin} \\ U_r & \text{else} \end{cases}\\ dE_f = 1 / T_e \cdot (U_{r2} - U_x - K_e \cdot E_f)\]

source
PowerDynamics.FourthOrderEqGovernorExciterAVRType
FourthOrderEqGovernorExciterAVR(H, P, D, Ω, T_d_dash ,T_q_dash ,X_q_dash ,X_d_dash,X_d, X_q, T_e, T_a, T_f, K_e, K_a, K_f, V_ref, R_d, T_sv, T_ch)

A node type that applies the 4th-order synchronous machine model with frequency/angle and voltage dynamics, including an Exciter, Automatic Voltage Regulator and Governor which is implemented according to P. Sauer, "Power System Dynamics and Stability". For an illustration of a synchronous machine schematic see P. Sauer, Fig. 3.1 on p. 25.

Exciter and Automatic Voltage Regulator: The equations for the systems that balance the AC synchronous machine voltage level by increasing or decreasing the exciter DC voltage. Note, within this model, the transient reactance in the d-axis of the generator needs to be included into the nodal admittance matrix. As the bus of this generator node type is constructed to be an internal generator bus.

Governor: The prime mover provides the mechanism for controlling the synchronous machine speed and, hence, terminal voltage frequency.

Usually the swing equation (SwingEq) is used for short time periods to analyze the transient behavior of generators in a power grid, the so-called first swing. The 4th-order model also takes the back reaction of the power flow onto the voltage into account. This has the effect that the angle of the voltage as seen by the power grid, and the angle of the rotating mass are no longer the same but become dynamically coupled.

Additionally to $u$, it has the internal dynamic variables

  • $ω$ representing the frequency of the rotator relative to the grid frequency $Ω$, i.e. the real frequency $ω_r$ of the rotator is given as $\omega_r = \Omega + \omega$ and
  • $θ$ representing the relative angle of the rotor with respect to the voltage angle $ϕ$.

Keyword Arguments

  • H: shaft inertia constant (given in [s]), defined according to P. Sauer, p. 33, eq. (3.60)

  • P: active (real) power output, also called the mechanical torque applied to the shaft, given in [pu]

  • D: damping coefficient (given in [s], see P. Sauer, eq. (5.156) where the damping torque is equal )

  • Ω: rated frequency of the power grid, often $2π⋅50Hz$

  • T_d_dash: time constant of d-axis, given in [s], see P. Sauer, chapter 3.7, p. 54 for a general explanation on time constants

  • T_q_dash: time constant of q-axis, given in [s]

  • X_d_dash: transient reactance of d-axis, given in [pu]

  • X_q_dash: transient reactance of q-axis, given in [pu]

  • X_d: reactance of d-, given in [pu]

  • X_d: reactance of q-axis, given in [pu]

  • T_e : Exciter time constant, integration rate associated with exciter control [s]

  • T_a : Maximum voltage regulator output [s]

  • T_f : Excitation control system stabilizer time constant [s]

  • K_e : Exciter constant related to self-excited field [pu]

  • K_a : Voltage Regulator gain [pu]

  • K_f : Excitation control system stabilizer gains [pu]

  • V_ref : Reference voltage for the AVR [pu]

  • R_d : Speed regulation $R_d=2π droop/Ω$ [s]

  • T_sv : Steam Valve time constant [s]

  • T_ch : Steam Chest time constant [s]

Mathematical Representation Synchronous Machine

Using FourthEq for node $a$ applies the equations

\[ u = -je_c e^{j\theta} = -j(e_d + je_q)e^{j\theta}\\ e_c= e_d + je_q = jue^{-j\theta}\\ i = -ji'e^{j\theta} = -j(i_d+ j i_q )e^{j\theta} = Y^L \cdot u \\ i_c= i_d + ji_q = jie^{-j\theta}\\ p = \Re (i^* u) \\\]

where complex voltage and current are described in a co-rotating frame with axes labeled d and q.

The fourth-order equations read (according to P. Sauer, "Power System Dynamics and Stability", p. 140, eqs. (6110)-(6114)) and p. 35 eqs(3.90)-(3.91)

\[ \frac{d\theta}{dt} = \omega \\ \frac{d\omega}{dt} = (P-D\omega - p -(X'_q-X'_d)i_d i_q)Ω_H\\ \frac{d e_q}{dt} = \frac{1}{T'_d} (- e_q - (X_d - X'_d) i_{d}+ E_f) \\ \frac{d e_d}{dt} = \frac{1}{T'_q} (- e_d + (X_q - X'_q) i_{q}) \\\]

Exciter and AVR equations

\[ u_{terminal} = e'_c - j X'_d i \\ S_{e}(e_{fd}) = 0.098e^{0.55 e_{fd}} \text{(according to P. Sauer, p. 70)} \\ \dfrac{dR_f}{dt} = \dfrac{1}{T_f} (-R_f + \dfrac{K_f}{T_f} e_f) \\ \dfrac{dv_r}{dt} = \dfrac{1}{T_a} (-v_r + (K_a R_f) -\dfrac{K_a K_f}{T_f}e_{fd} + K_a (V_{ref} - |u_{terminal}|)) \\ \dfrac{de_{fd}}{dt} = \dfrac{1}{T_e} (-K_e + S_{e}(e_{fd})e_{fd} + v_r) \\\]

Governor equations

\[ \dfrac{dP_m}{dt} = \dfrac{1}{T_{ch}} (-P_m + P_{sv}) \\ \text{Assumption}: T_m = P_m \\ \dfrac{dP_{sv}}{dt} = \dfrac{1}{T_{sv}} (-P_{sv} + P_c -\dfrac{1}{R_d} (\dfrac{\omega}{Ω} - 1)) \\\]

The equations for frequency and phase represent energy conservation and phase shift. The dynamic equations for the complex voltage show the relationship between the dynamicy of flux linkages and currents which must reflect a conservative coupling field.

With the PowerDynamics.jl naming conventions of $i$ and $u$ they read as

\[ \dot u = \frac{d}{dt}(-j e_c e^{j\theta})=-j(\dot e_d + j\dot e_q)e^{j\theta} + uj\omega \\\]

source
PowerDynamics.FourthOrderEqGovernorIEEEG1Type

A node type that applies the 4th-order synchronous machine model with frequency/angle and voltage dynamics, which is implemented according to P. Sauer, "Power System Dynamics and Stability". For an illustration of a synchronous machine schematic see P. Sauer, Fig. 3.1 on p. 25. Usually the swing equation (SwingEq) is used for short time periods to analyze the transient behavior of generators in a power grid, the so-called first swing. The 4th-order model also takes the back reaction of the power flow onto the voltage into account. This has the effect that the angle of the voltage as seen by the power grid, and the angle of the rotating mass are no longer the same but become dynamically coupled.

In addition to the 4th-order model the Type IEEEG1 governor was implemented. It is used for tandem compound, double reheat steam turbine systems. The type was implemented using the following resources as the guide line: "MatDyn" Copyright ©2009 Stijn Cole and "Dynamic Models for Turbine-Governors in Power System Studies", IEEE PES, 2013, Page 2 - 2

Additionally to $u$, it has the internal dynamic variables

  • $ω$ representing the frequency of the rotator relative to the grid frequency $Ω$, i.e. the real frequency $ω_r$ of the rotator is given as $\omega_r = \Omega + \omega$ and
  • $θ$ representing the relative angle of the rotor with respect to the voltage angle $ϕ$.
  • $Pm$ representing the active power output, also called the mechanical torque applied to the shaft, given in [pu]
  • $x1$ representing an internal variable block input
  • $z$ representing an internal variable block output
  • $P$ representing the power of the servomotor [pu]

Keyword Arguments

  • H: shaft inertia constant (given in [s]), defined according to P. Sauer, p. 33, eq. (3.60)
  • D: damping coefficient (given in [s], see P. Sauer, eq. (5.156) where the damping torque is equal )
  • Ω: rated frequency of the power grid, often $2π⋅50Hz$
  • T_d_dash: time constant of d-axis, given in [s], see P. Sauer, chapter 3.7, p. 54 for a general explanation on time constants
  • T_q_dash: time constant of q-axis, given in [s]
  • X_d_dash: transient reactance of d-axis, given in [pu]
  • X_q_dash: transient reactance of q-axis, given in [pu]
  • X_d: reactance of d-, given in [pu]
  • X_d: reactance of q-axis, given in [pu]
  • E_f: scaled field voltage, which, if set equal to 1.0 pu, gives 1.0 pu open-circuit terminal voltage. The physical device that provides the value of E_f is called the exciter (according to P. Sauer, p. 65)

Governer

  • P0: Reference power
  • Pmax: Max power limit imposed by valve or gate control [pu]
  • Pmin: Min power limit imposed by valve or gate control [pu]
  • Pup: Max main control valve rate of change [pu/s]
  • Pdown: Min main control valve rate of change [pu/s]
  • T1: Controller lag compensation [s]
  • T2: Controller lead compensation [s]
  • T3: Valve position time constant (servomotor mechanism) [s]
  • K: Total effective speed-governing system gain [pu]

The fourth-order equations read (according to P. Sauer, "Power System Dynamics and Stability", p. 140, eqs. (6110)-(6114)) and p. 35 eqs(3.90)-(3.91)

\[ \frac{d\theta}{dt} = \omega \\ \frac{d\omega}{dt} = (P-D\omega - p -(X'_q-X'_d)i_d i_q)Ω_H\\ \frac{d e_q}{dt} = \frac{1}{T'_d} (- e_q - (X_d - X'_d) i_{d}+ E_f) \\ \frac{d e_d}{dt} = \frac{1}{T'_q} (- e_d + (X_q - X'_q) i_{q}) \\\]

The IEEEG1 Governor Model applies the following equations:

\[ dx_1 = K \cdot \left(\frac{-1}{T_1} \cdot x_1 + \left(1 - \frac{T_2}{T_1}\right) \cdot \omega\right) \text{ Block Input} \\ dP = \left(\frac{1}{T_1}\right) \cdot x_1 + \left(\frac{T_2}{T_1}\right) \cdot \omega \\ y = \left(\frac{1}{T_3}\right) \cdot (P_0 - P - P_m) \text{ Block Output} \]

Limiting the valve rate of change:

\[ y_{temp} = \begin{cases} P_{up} & \text{if } y > P_{up} \\ P_{down} & \text{if } y < P_{down} \\ y & \text{else} \end{cases}\\ dz = y_{temp}\]

Limiting the power imposed by the valve or gate control:

\[ dP_m = \begin{cases} (1 - P_{max}) \cdot dP_m & \text{if } z > P_{max} \\ (1 - P_{min}) \cdot dP_m & \text{if } z < P_{min} \\ y_{temp} & \text{else} \end{cases}\]

source
PowerDynamics.PQAlgebraicType
    PQAlgebraic(; P,Q)

A node type that locally fixes the active ($P$) and reactive power ($Q$) output of the node.

Keyword Arguments

  • P: active power set point
  • Q: reactive power set point

Mathematical Representation

Using PQAlgebraic for node $a$ applies the equation

\[0 = (P_a + jQ_a) - u_a \cdot i_a^*.\]

source
PowerDynamics.PVAlgebraicType
PVAlgebraic(;P,V)

A node type that locally fixes the active power ($P$) and the voltage magnitude ($V$) of the node.

Keyword Arguments

  • P: the active (real) power output
  • V: voltage magnitude

Mathematical Representation

Using PVAlgebraic for node $a$ applies the equations

\[0 = P_a - \Re\left(u_a \cdot i_a^*\right), \\ 0 = V_a - \left\|u_a\right\|.\]

source
PowerDynamics.PVInverterWithFrequencyControlType
PVInverterWithFrequencyControl(;I_n,k_PLL,f,f_s,T_m,k_P,τ_ω)

This implementation of a generic inverter model is built with standard components according to the report on "Modelling of Inverter-Based Generation for Power System Dynamic Studies" of the joint CIGRE working group.

Additionally to $u$, the global network-side voltage, it has the internal dynamic variables:

  • θ_PLL: phase determined by the PLL
  • v_xm: x-component of measured grid-side voltage
  • v_ym: y-component of measured grid-side voltage
  • P: power infeed of power plant
  • ω: frequeny deviation in rad/s.

Keyword arguments are:

  • I_n: the nominal current of the PV plant
  • k_PLL: the PLL constant,
  • f: the nominal frequency (50Hz usually)
  • f_s: the set point at which droop control is triggered
  • T_m: the time constant of the low pass filter for measuring the voltage locally at the inverter
  • k_P: the droop control constant
  • τ_ω time constant of the frequeny filter

Mathematical Representation

Using PVInverterWithFrequencyControl applies the equations

\[ v_x = \Re(u)\\ v_y = \Im(u)\]

The network-side power is

\[p = \Re(u \cdot i^*)\]

The nominal current of the PV inverter, $I_n$, is completely active current (we do not consider voltage regulation so far):

\[ I_{P,max} = I_n \\ I_{Q,max} = 0\]

\[ \frac{dv_{xm}}{dt} = 1/T_m(v_x-v_{xm})\\ \frac{dv_{ym}}{dt} = 1/T_m(v_y-v_{ym})\]

Since PowerDynamics is working with phasor units, this model has two d-q-systems (for the power plant and for the grid), $I_p/v_d$ and $I_q/v_q$ are the local coordinates and $i_x/v_x$ and $i_y/v_y$ are the global (grid) coordinates.

\[ u_dq = (v_{xm}+j v_{ym})e^{-j\theta_{PLL}} v_d = \Re(u_dq)\\ v_q = \Im(u_dq)\]

The local coordinates are chosen such that $v_q=0$:

\[ \dot{\theta}_{PLL} = v_q(k_{PLL})\]

The frequency deviation, $\dot{\theta}_{PLL}$, is obtained thanks to the PLL controller of the units. Therefore, the measured frequency in Hz is given by

\[ f_m = (1+\dot{\theta}_{PLL})f.\]

An additional filter is added to avoid a too fast PV reaction leading to unwanted oscillations of the active current during a short-term fault:

\[ \frac{d\omega}{dt} = 1/\tau_\omega(-\omega + \dot{\theta}_{PLL}\cdot2\pi f)\]

With the active power determined by the droop control the current I_Pequals:

\[ I_P=P/v_d\]

Implementing the frequency dead band for overfrequnency control with:

\[ \frac{dP}{dt} =-k_P \cdot d\omega \cdot P_{ext} \ , \text{ if } f_m>f_s\\ \frac{dP}{dt} = 0 \ , \text{ else}\]

where $f_s$ is the frequency at which the active power output starts decreasing and $k_P$ is the droop control constant (in percentage of the rated power $P_{ext}$):

\[ P_{ext} = \Re(I_{P,max}\cdot(v_d+jv_q))= I_N v_d.\]

\[ 0\cdot \dot{u} =i - (I_P+ j I_Q)e^{j\theta_{PLL}}\]

source
PowerDynamics.RLCLoadType
RLCLoad(R,L,C)

EXPERIMENTAL A node type that represents the RLC load model according to "Power Systems Electromagnetic Transients Simulation", Neville Watson and Jos Arrillaga, IET 2007, p.59, eq. (3.47)

Keyword Arguments

  • R: resistance
  • L: inductance
  • C: capacitance

Mathematical Representation

\[ \dfrac{du_C}{dt} = \frac{1}{C}i_L(t)\\ \dfrac{di_L}{dt} = -\frac{R}{L} i_L(t)+\frac{1}{L} u(t)\]

source
PowerDynamics.SlackAlgebraicType
SlackAlgebraic(;U)

A node type that locally fixes the complex voltage ($U$) of the node.

As the complex voltage can be represented as $U=Ve^{i\phi}$, this is equivlant to fixing the voltage magnitude $V$ and the angle $\phi$.

Keyword Arguments

  • U: the complex voltage

Mathematical Representation

Using SlackAlgebraic for node $a$ applies the equation

\[0 = U_a - u_a.\]

source
PowerDynamics.SwingEqType
SwingEq(;H, P, D, Ω)

A node type that applies the swing equation to the frequency/angle dynamics and keeps the voltage magnitude as is. In the following, we followed the implementation of the 2nd-order Synchronous Machine Model according to Sauer et. al. "Power system dynamics and stability", 1998.

Additionally to $u$, it has the internal dynamic variable $\omega$ representing the frequency of the rotator relative to the grid frequency $\Omega$, i.e. the real frequency $\omega_r$ of the rotator is given as $\omega_r = \Omega + \omega$.

Keyword Arguments

  • H: inertia constant (given in [s]), defined according to P. Sauer, p. 33, eq. (3.60)
  • P: active (real) power output, also called the mechanical torque applied to the shaft, given in [pu]
  • D: damping coefficient, (given in [s], see P. Sauer, eq. (5.156) where the damping torque is equal )
  • Ω: rated frequency in [1/s] of the power grid, often $2\pi⋅50$Hz

Mathematical Representation

Using SwingEq for node $a$ applies the equations

\[\frac{du_a}{dt} = j \omega_a u_a, \\ \frac{2H}{\Omega}\frac{d\omega_a}{dt} = P_a - D_a\omega_a - \Re\left(u_a \cdot i_a^*\right),\]

which is equivalent to

\[\frac{d\phi_a}{dt} = \omega_a, \\ v = v(t=0) = \text{const.} \\ \frac{2H}{\Omega}\frac{d\omega_a}{dt} = P_a - D_a\omega_a - \Re\left(u_a \cdot i_a^*\right),\]

where $H = \frac{1}{2}\frac{J\Omega^2}{S_b}$ for a two-pole machine accoding to Sauer et. al. eq. (3.60) on p. 33. S_b is the rated three-phase MVA of the power system.

source
PowerDynamics.SwingEqLVSType
SwingEqLVS(;H, P, D, Ω, Γ, V)

A node type that applies the swing equation to the frequency/angle dynamics and has a linear voltage stability (LVS) term.

Additionally to $u$, it has the internal dynamic variable $\omega$ representing the frequency of the rotator relative to the grid frequency $\Omega$, i.e. the real frequency $\omega_r$ of the rotator is given as $\omega_r = \Omega + \omega$.

Keyword Arguments

  • H: inertia constant (given in [s]), defined according to P. Sauer, p. 33, eq. (3.60)
  • P: active (real) power output, also called the mechanical torque applied to the shaft, given in [pu]
  • D: damping coefficient, (given in [s], see P. Sauer, eq. (5.156) where the damping torque is equal )
  • Ω: rated frequency in [1/s] of the power grid, often $2\pi⋅50$Hz
  • Γ: voltage stability coefficient
  • V: set voltage, usually 1

Mathematical Representation

Using SwingEq for node $a$ applies the equations

\[\frac{du_a}{dt} = j \omega_a u_a - \frac{u}{\|u\|} Γ_a (v_a - V_a), \\ \frac{2H}{\Omega}\frac{d\omega_a}{dt} = P_a - D_a\omega_a - \Re\left(u_a \cdot i_a^*\right),\]

which is equivalent to

\[\frac{d\phi_a}{dt} = \omega_a, \\ \frac{dv_a}{dt} = - Γ_a (v_a - V_a) \\ \frac{2H}{\Omega}\frac{d\omega_a}{dt} = P_a - D_a\omega_a - \Re\left(u_a \cdot i_a^*\right),\]

source
PowerDynamics.VSIMinimalType
VSIMinimal(;τ_P,τ_Q,K_P,K_Q,E_r,P,Q)

A node type that applies the frequency and voltage droop control to control the frequency and voltage dynamics. Implemented according to Schiffer et. al., "Conditions for stability of droop-controlled inverter-based microgrids", Automatica, 2014.

VSIMinimal models an inverters as AC voltage source which means the amplitude and frequency can defined by the designer (often called grid-forming inverter mode). The frequency and voltage regulation is assumed to be instantaneous. In addition simple proportional controllers are implemented for frequency and voltage such that the frequency ω and voltage amplitudes v of the inverters are modified depending on the deviations (with respect to a desired value) of the active and reactive powers, respectively. it is assumed that active and reactive power are measured via low pass filters with time constant τ_P and τ_Q, respectively. VSIMinimal can be derived from VSIVoltagePT1 by assuming an instantaneous voltage regulation without delay.

Additionally to $u$, it has the internal dynamic variable $ω$ representing the frequency of the inverter frequency relative to the grid frequency $Ω=2π50$Hz, i.e. the real frequency $ω_r$ of the inverter frequency is given as $ω_r = Ω + ω$.

Keyword Arguments

  • τ_p: time constant active power measurement
  • τ_Q: time constant reactive power measurement
  • K_P: droop constant frequency droop
  • K_Q: droop constant voltage droop
  • V_r: reference/ desired voltage
  • P: active (real) power infeed
  • Q: reactive (imag) power infeed

Mathematical Representation

Using VSIMinimal for node $a$ (according to J. Schiffer et. al., eq. (7)) gives the equations

\[\dot{\phi}_a=\omega_a\\ \dot{\omega}_a=\frac{1}{\tau_{P,a}}[-\omega_a-K_{P,a} (\Re\left(u_a \cdot i_a^*\right)-P_{a})]\\ \tau_Q\dot{v}_a=-v_a+V_{r}-K_{Q,a} (\Im\left(u_a \cdot i_a^*\right)-Q_{a})\\ \dot{u}_a=\dot{v_a}e^{j\phi}+j\omega_a u_a\]

source
PowerDynamics.VSIVoltagePT1Type
VSIVoltagePT1(;τ_v,τ_P,τ_Q,K_P,K_Q,E_r,P,Q)

A node type that applies the frequency and voltage droop control to control the frequency and voltage dynamics. Implemented according to Schiffer et. al., "Conditions for stability of droop-controlled inverter-based microgrids", Automatica, 2014.

VSIVoltagePT1 models an inverters as AC voltage source which means the amplitude and frequency can defined by the designer (often called grid-forming inverter mode). The frequency regulation is assumed to be instantaneous, but the voltage control happens with a delay τ_v that is represented by a first order filter. In addition simple proportional controllers are implemented for frequency and voltage such that the frequency ω and voltage amplitudes v of the inverters are modified depending on the deviations (with respect to a desired value) of the active and reactive powers, respectively. ift is assumed that active and reactive power are measured via low pass fileters with time constant τ_P and τ_Q, respectively.

Hence, additionally to u, it has the internal dynamic variables

  • ω representing the frequency of the inverter relative to the grid frequency $Ω=2π50$Hz, i.e. the real frequency $ω_r$ of the inverter is given as $ω_r = Ω + ω$.
  • q_m is the measured reactive power at the grid connection point.

Keyword Arguments

  • τ_v: time constant voltage control delay
  • τ_P: time constant active power measurement
  • τ_Q: time constant reactive power measurement
  • K_P: droop constant frequency droop
  • K_Q: droop constant voltage droop
  • V_r: reference/ desired voltage
  • P: active (real) power infeed
  • Q: reactive (imag) power infeed

Mathematical Representation

Using VSIVoltagePT1 for node $a$ (according to J. Schiffer et. al., eq. (6)) gives the equations

\[\dot{\phi}_a=\omega_a\\ \dot{\omega}_a=\frac{1}{\tau_{P,a}}[-\omega_a-K_{P,a} (\Re\left(u_a \cdot i_a^*\right)-P_{ref,a})]\\ \tau_v\dot{v}_{a}=-v_a+V_{ref}-K_{Q,a}(q_{m,a}-Q_{ref,a})\\ \tau_Q \dot{q}_{m,a}=-q_{m,a}+\Im\left(u_a \cdot i_a^*\right)\\ \dot{u}_a=\dot{v_a}e^{j\phi}+j\omega_a u_a\\\]

In general $τ_V ≪ τ_P$, assuming $τ_V = 0$ would then lead to VSIMinimal.

source
PowerDynamics.VoltageDependentLoadType
    VoltageDependentLoad(;P, Q, U, A, B)

A node type that locally fixes the active ($P$) and reactive power ($Q$) output of the node.

Keyword Arguments

  • P: active power demand
  • Q: reactive power demand
  • U : the voltage set point
  • A : relative share of quadratic voltage dependence
  • B : relative share of linear voltage dependence

Mathematical Representation

Using VoltageDependentLoad for node $a$ applies the equation

\[0 = S_a ( A \cdot (u_a/U_a)^2 + B \cdot (u_a/U_a) + 1 - A - B) - u_a \cdot i_a^*.\]

source
PowerDynamics.CompositeNodeType
CompositeNode(CurrentNodes)

A composite node consisting of current and power sources provided, as well as up to one optional voltage controling node. This assumes that the current nodes are implemented as

du = i - I_node

and the power nodes are implemented with

du = u*conj(i) - P_node

Important!! The individual nodes are given the current that is arriving from the grid into the bus, not the current they themself inject! Check the definitions of the nodes going into the CompositeType to make sure they have the right dynamics.

Experimental!! This node has not been sufficiently tested for correctness yet. For example the plotting recipe does not work with this node, yet!

source