Injector Models
RAMSES custom injector models represent loads, induction machines, inverter-based resources (IBR), and battery energy storage systems (BESS) connected to network buses.
Load Models
Section titled “Load Models”LOAD (inj_load): Exponential Recovery Load
Section titled “LOAD (inj_load): Exponential Recovery Load”Description
Section titled “Description”The exponential recovery load model captures the transient and steady-state voltage and frequency dependency of aggregated loads. Immediately after a voltage disturbance, the load behaves according to a transient voltage exponent; it then recovers exponentially to a steady-state behaviour described by a different exponent. The model supports separate active () and reactive () power recovery dynamics, each with individual minimum/maximum limiters on the recovery variable.
Scientific Description
Section titled “Scientific Description”The model is parameterized in terms of initial active and reactive conductance/susceptance, and . Two recovery state variables and evolve according to:
where is the per-unit speed deviation, is the bus voltage magnitude, is the initial voltage, are transient exponents, are steady-state exponents, and is the load recovery time constant. The injected currents are then:
When the recovery variable hits its limit (due to e.g. Stalling or complete voltage collapse), the limit is held until the direction of the derivative reverses.
Parameters
Section titled “Parameters”| # | Name | Description | Unit |
|---|---|---|---|
| 1 | DP | Frequency sensitivity of active power | pu/pu |
| 2 | A1 | Proportion of type-1 component in | |
| 3 | alpha1 | Transient voltage exponent for (type 1) | |
| 4 | A2 | Proportion of type-2 component in | |
| 5 | alpha2 | Transient voltage exponent for (type 2) | |
| 6 | alpha3 | Transient voltage exponent for (type 3, proportion ) | |
| 7 | DQ | Frequency sensitivity of reactive power | pu/pu |
| 8 | B1 | Proportion of type-1 component in | |
| 9 | beta1 | Transient voltage exponent for (type 1) | |
| 10 | B2 | Proportion of type-2 component in | |
| 11 | beta2 | Transient voltage exponent for (type 2) | |
| 12 | beta3 | Transient voltage exponent for (type 3) |
Internal computed parameters include the steady-state exponents for each component (derived from the transient exponents), initial conductance , susceptance , and initial voltage .
State Variables
Section titled “State Variables”| Variable | Description |
|---|---|
iy | -component of injected current (pu on system base) |
ix | -component of injected current (pu on system base) |
xp | Active power recovery variable (dimensionless) |
xq | Reactive power recovery variable (dimensionless) |
Observables: P, Q, xp, xq
Usage Example
Section titled “Usage Example”INJEC LOAD LOAD1 BUS1 1. 1. 0. 0. 1.5 0.3 1.0 0.2 2.0 0.5 1.8 0.4 2.5 0.1 3.0 2.0 ;Parameters: DP A1 alpha1 A2 alpha2 alpha3 DQ B1 beta1 B2 beta2 beta3
vfd_load (inj_vfd_load): Variable Frequency Drive Load
Section titled “vfd_load (inj_vfd_load): Variable Frequency Drive Load”Description
Section titled “Description”The VFD load model represents aggregate industrial loads driven by variable-frequency drives, where the power consumption exhibits a composite voltage-dependent characteristic with multiple exponential components and frequency sensitivity. It also includes low-voltage protection: below a configurable threshold , the load switches to a constant-admittance representation, preventing numerical difficulties during deep voltage sags.
Scientific Description
Section titled “Scientific Description”The active and reactive powers depend on bus voltage and frequency deviation :
Below , an equivalent constant admittance is used:
where and are computed at initialization to ensure continuity at . The switch between the two regimes is governed by a piecewise-linear function of :
A small voltage filter (time constant 0.003 s) smooths the transition. The frequency deviation can optionally be computed from the local bus frequency (measured via an f_inj block with time constant ) or from the system centre-of-inertia speed.
The initial voltage can differ from the transmission bus voltage if a distribution transformer ratio is implied (set to specify the distribution-side voltage; otherwise the transmission voltage is used directly).
Parameters
Section titled “Parameters”| # | Name | Description | Unit |
|---|---|---|---|
| 1 | Dp | Frequency sensitivity of active power | pu/pu |
| 2 | a1 | Fraction of type-1 component in | |
| 3 | alpha1 | Voltage exponent of type-1 component | |
| 4 | a2 | Fraction of type-2 component in | |
| 5 | alpha2 | Voltage exponent of type-2 component | |
| 6 | alpha3 | Voltage exponent of type-3 component (fraction ) | |
| 7 | Dq | Frequency sensitivity of reactive power | pu/pu |
| 8 | b1 | Fraction of type-1 component in | |
| 9 | beta1 | Voltage exponent of type-1 component | |
| 10 | b2 | Fraction of type-2 component in | |
| 11 | beta2 | Voltage exponent of type-2 component | |
| 12 | beta3 | Voltage exponent of type-3 component | |
| 13 | Vinit | Initial distribution-bus voltage (0 = use transmission voltage) | pu |
| 14 | Vlow | Voltage threshold for constant-admittance regime (recommended 0.5–0.7) | pu |
| 15 | foption | 1 = use local bus frequency; 0 = use COI speed | flag |
| 16 | Tmes | Frequency measurement time constant | s |
State Variables
Section titled “State Variables”| Variable | Description |
|---|---|
Vreal | Voltage at equivalent distribution bus |
V | Filtered distribution-bus voltage (3 ms filter) |
P | Active power consumed |
Q | Reactive power consumed |
fbus | Local bus frequency (used if foption=1) |
df | Frequency deviation |
u | Regime switch (1 = above , 0 = constant admittance) |
Observables: P, Q, df, u
Usage Example
Section titled “Usage Example”INJEC vfd_load VFD1 BUS_IND 1. 1. 0. 0. 1.5 0.7 2.0 0.2 1.0 0.5 1.2 0.5 2.5 0.1 1.5 0.8 0.0 0.6 0 0.1 ;RESTLD (inj_restld): Restorative Load
Section titled “RESTLD (inj_restld): Restorative Load”Description
Section titled “Description”The restorative load model represents loads that self-restore toward a nominal characteristic after a voltage disturbance. The load’s active and reactive powers are governed by two internal recovery variables that evolve dynamically, allowing the simulation to capture the slow restoration of thermostatically controlled loads (heating, cooling) and similar self-restoring demand.
Scientific Description
Section titled “Scientific Description”The recovery variable for active power satisfies:
with analogous equation for . Here and are the steady-state and transient voltage exponents respectively. Limiters are applied. The injected currents are expressed as:
where the ratio governs the voltage dependence through vrat.
Parameters
Section titled “Parameters”| # | Name | Description | Unit |
|---|---|---|---|
| 1 | DP | Frequency sensitivity of active power | pu/pu |
| 2 | alphat | Transient active power voltage exponent | |
| 3 | alphas | Steady-state active power voltage exponent | |
| 4 | xP_min | Minimum limit for | |
| 5 | xP_max | Maximum limit for | |
| 6 | DQ | Frequency sensitivity of reactive power | pu/pu |
| 7 | betat | Transient reactive power voltage exponent | |
| 8 | betas | Steady-state reactive power voltage exponent | |
| 9 | xQ_min | Minimum limit for | |
| 10 | xQ_max | Maximum limit for | |
| 11 | Tr | Load recovery time constant | s |
State Variables
Section titled “State Variables”| Variable | Description |
|---|---|
iy | -component of injected current |
ix | -component of injected current |
xp | Active power recovery variable |
xq | Reactive power recovery variable |
Observables: P, Q, xp, xq
Usage Example
Section titled “Usage Example”INJEC RESTLD RESTLD1 BUS2 1. 1. 0. 0. 1.5 0.5 2.0 0.0 2.0 1.2 0.5 2.5 0.0 2.0 60.0 ;PQ (inj_PQ): Constant PQ Load
Section titled “PQ (inj_PQ): Constant PQ Load”Description
Section titled “Description”The simplest injector model: maintains constant active and reactive power consumption regardless of bus voltage or frequency. The power is fixed at its initial operating-point value. A small first-order filter (time constant Tout) drives the injected currents smoothly to their target values, preventing algebraic loops.
Scientific Description
Section titled “Scientific Description”The current references are set to deliver the initial powers and at the measured voltage :
These references pass through a first-order filter with time constant to produce the actual injected currents:
Parameters
Section titled “Parameters”| # | Name | Description | Unit |
|---|---|---|---|
| 1 | Tout | Output filter time constant (recommended: 0.01 s) | s |
Initial conditions , , are computed automatically at initialization.
State Variables
Section titled “State Variables”| Variable | Description |
|---|---|
ix | Injected -current |
iy | Injected -current |
Ixset | Current reference |
Iyset | Current reference |
P | Observed active power |
Q | Observed reactive power |
V | Bus voltage magnitude |
Observables: P, Q
Usage Example
Section titled “Usage Example”INJEC inj_PQ LOAD_PQ BUS3 1. 1. 0. 0. 0.01 ;THEVEQ (inj_theveq): Thévenin Equivalent
Section titled “THEVEQ (inj_theveq): Thévenin Equivalent”Description
Section titled “Description”Models an external network or generator cluster as a Thévenin equivalent: an ideal voltage source behind a pure reactance . The model computes the internal voltage magnitude and phase angle at initialization from the initial bus conditions and holds them constant during the simulation. It is useful for representing neighbouring system equivalents or simplified machine representations.
Scientific Description
Section titled “Scientific Description”The Thévenin reactance is obtained from the specified short-circuit power (MVA):
The internal voltage phasor is computed at :
During simulation the injected currents satisfy:
Parameters
Section titled “Parameters”| # | Name | Description | Unit |
|---|---|---|---|
| 1 | XTH | Short-circuit power of the equivalent (converted to at initialization) | MVA |
Internal parameters ETH (Thévenin voltage magnitude, pu) and phase (internal angle, rad) are computed automatically.
State Variables
Section titled “State Variables”| Variable | Description |
|---|---|
iy | Injected -current |
ix | Injected -current |
Observables: P, Q (in MW and Mvar at system base)
Usage Example
Section titled “Usage Example”INJEC THEVEQ EQUIV1 SLACK_BUS 1. 1. 0. 0. 2000.0 ;Induction Machine Models
Section titled “Induction Machine Models”INDMACH1 (inj_indmach1): Single-Cage Induction Machine
Section titled “INDMACH1 (inj_indmach1): Single-Cage Induction Machine”Description
Section titled “Description”A single-cage (single-rotor-circuit) induction machine model for motor loads. The machine is represented on its own MVA base (or inferred from load factor LF) with a shunt capacitor to represent power factor correction. The mechanical torque is a quadratic function of rotor speed. At initialization, the model solves nonlinear algebraic equations to find the operating-point slip and flux linkages.
Scientific Description
Section titled “Scientific Description”The machine uses the standard - reference-frame formulation with and . The rotor flux-linkage equations are:
where and is the rotor mechanical speed. The equations for the stator (with shunt susceptance ) are:
The rotor speed dynamics follow the swing equation:
where the electromagnetic torque is:
and the mechanical torque is the quadratic load curve:
Parameters
Section titled “Parameters”| # | Name | Description | Unit |
|---|---|---|---|
| 1 | SNOM | Machine nominal apparent power (0 = infer from LF) | MVA |
| 2 | RS | Stator resistance | pu |
| 3 | Lls | Stator leakage inductance | pu |
| 4 | LSR | Magnetizing inductance | pu |
| 5 | RR | Rotor resistance | pu |
| 6 | Llr | Rotor leakage inductance | pu |
| 7 | H | Machine inertia constant | s |
| 8 | A | Quadratic torque-speed coefficient | |
| 9 | B | Linear torque-speed coefficient | |
| 10 | LF | Load factor (for SNOM inference) |
State Variables
Section titled “State Variables”| Variable | Description |
|---|---|
iy | -component of stator current |
ix | -component of stator current |
psidr | -axis rotor flux linkage |
psiqr | -axis rotor flux linkage |
omegam | Rotor mechanical speed |
Observables: P, Qmot+comp, Qmot, omega, Tm
Usage Example
Section titled “Usage Example”INJEC INDMACH1 MTR1 BUS_MV 1. 1. 0. 0. 10.0 0.01 0.10 2.50 0.015 0.10 1.5 0.8 0.1 0.0 ;INDMACH2 (inj_indmach2): Double-Cage Induction Machine
Section titled “INDMACH2 (inj_indmach2): Double-Cage Induction Machine”Description
Section titled “Description”A double-cage (double-rotor-circuit) induction machine model following the Eurostag formulation. Two parallel rotor cages allow more accurate representation of the machine’s impedance-vs-frequency characteristic, which is especially important for the starting transient. The model structure mirrors inj_indmach1 but includes a second set of rotor flux states.
Scientific Description
Section titled “Scientific Description”The machine has parameters: stator resistance , stator leakage , magnetizing inductance , cage-1 resistance and leakage , cage-2 resistance and leakage . The state vector is with flux-linkage equations for each cage:
where and . The total electromagnetic torque combines contributions from both cages:
The swing equation is identical to inj_indmach1.
Parameters
Section titled “Parameters”| # | Name | Description | Unit |
|---|---|---|---|
| 1 | SNOM | Machine MVA rating (0 = infer from LF) | MVA |
| 2 | R1 | Stator resistance | pu |
| 3 | L1 | Stator leakage inductance | pu |
| 4 | Lm | Magnetizing inductance | pu |
| 5 | R2 | First cage resistance | pu |
| 6 | L2 | First cage leakage inductance | pu |
| 7 | R3 | Second cage resistance | pu |
| 8 | L3 | Second cage leakage inductance | pu |
| 9 | H | Inertia constant | s |
| 10 | A | Quadratic torque-speed coefficient | |
| 11 | B | Linear torque-speed coefficient | |
| 12 | LF | Load factor (for SNOM inference) |
State Variables
Section titled “State Variables”| Variable | Description |
|---|---|
iy | -component of stator current |
ix | -component of stator current |
psidr1 | -axis flux of first rotor cage |
psiqr1 | -axis flux of first rotor cage |
psidr2 | -axis flux of second rotor cage |
psiqr2 | -axis flux of second rotor cage |
omegam | Rotor mechanical speed |
Observables: P, Qmot+comp, Qmot, omega
Usage Example
Section titled “Usage Example”INJEC INDMACH2 MTR2 BUS_MV 1. 1. 0. 0. 10.0 0.01 0.08 2.00 0.02 0.06 0.04 0.10 1.5 0.8 0.1 0.0 ;INDM1 (inj_INDM1): Alternative Induction Machine
Section titled “INDM1 (inj_INDM1): Alternative Induction Machine”The data-file model name is INDM1 (or inj_INDM1).
Description
Section titled “Description”An alternative single-cage induction machine model that uses the INI_indmach1 helper function for initialization. It is equivalent in physics to inj_indmach1 but implements the equations using RAMSES .txt-style model syntax with explicit state initialization calls. This can simplify parameterization when the helper function’s output is directly used.
Scientific Description
Section titled “Scientific Description”The model equations match those of inj_indmach1, whose block diagram applies here unchanged. The key distinction is the use of the INI_indmach1 function at parameter-evaluation time to pre-compute , , and the initial flux linkages and rotor speed, rather than solving the initialization system in Fortran. With and , the rotor flux equations are:
The rotor speed integral uses:
with a lower limit of .
Parameters
Section titled “Parameters”| # | Name | Description | Unit |
|---|---|---|---|
| 1 | SNOM | Machine MVA rating | MVA |
| 2 | RS | Stator resistance | pu |
| 3 | Lls | Stator leakage inductance | pu |
| 4 | LSR | Magnetizing inductance | pu |
| 5 | RR | Rotor resistance | pu |
| 6 | Llr | Rotor leakage inductance | pu |
| 7 | H | Inertia constant | s |
| 8 | A | Quadratic torque-speed coefficient | |
| 9 | B | Linear torque-speed coefficient | |
| 10 | LF | Load factor |
Computed internally: BSH (shunt susceptance), TM0 (initial mechanical torque), LSS, LRR.
State Variables
Section titled “State Variables”| Variable | Description |
|---|---|
Psidr | -axis rotor flux linkage |
Psiqr | -axis rotor flux linkage |
omegam | Rotor mechanical speed |
iym, ixm | Stator current components (on machine base) |
dPsidr, dPsiqr, domegam | Time-derivative auxiliary states |
Observables: omegam
Usage Example
Section titled “Usage Example”INJEC INDM1 MTR3 BUS_MV 1. 1. 0. 0. 10.0 0.01 0.10 2.50 0.015 0.10 1.5 0.8 0.1 0.0 ;Renewable Generation / Inverter-Based Resources
Section titled “Renewable Generation / Inverter-Based Resources”IBG (inj_IBG): Inverter-Based Generator (Generic IBR)
Section titled “IBG (inj_IBG): Inverter-Based Generator (Generic IBR)”Description
Section titled “Description”A generic inverter-based generation model suitable for representing aggregated distributed generation or any grid-following IBR. The model includes a Phase-Locked Loop (PLL), inner current control with active () and reactive () current commands, LVRT/HVRT logic with voltage-dependent reactive current injection, frequency-responsive active power modulation, and reconnection logic after disconnection events.
Scientific Description
Section titled “Scientific Description”The PLL tracks the terminal voltage angle via a second-order PI controller with a freeze option below :
where is the -axis terminal voltage in the PLL frame. The current commands and are derived from outer controls:
-
Active power is modulated by frequency according to frequency deadband
fdbd: -
During voltage dips (LVRT), reactive current is boosted:
-
Current magnitude is limited to with priority to reactive current during LVRT.
The injected currents in - frame are:
Parameters
Section titled “Parameters”| # | Name | Description | Unit |
|---|---|---|---|
| 1 | Imax | Maximum current magnitude | pu |
| 2 | IN | Nominal current | pu |
| 3 | Iprate | Active current ramp rate | pu/s |
| 4 | Tg | Generator time constant | s |
| 5 | Tm | Measurement filter time constant | s |
| 6 | tLVRT1 | LVRT ride-through time threshold 1 | s |
| 7 | tLVRT2 | LVRT ride-through time threshold 2 | s |
| 8 | tLVRTint | LVRT integration time | s |
| 9 | Vmax | Maximum voltage for operation | pu |
| 10 | tau | PLL response time | ms |
| 11 | Vminpll | Voltage below which PLL is frozen | pu |
| 12 | a | LVRT voltage-current curve slope | |
| 13 | Vmin | Minimum LVRT voltage | pu |
| 14 | Vint | Intermediate LVRT voltage | pu |
| 15 | fmin | Minimum frequency for operation | pu |
| 16 | fmax | Maximum frequency for operation | pu |
| 17 | fstart | Frequency threshold for P modulation | pu |
| 18 | b | Frequency droop gain | |
| 19 | fr | Reference frequency | pu |
| 20 | Tr | Reconnection delay after trip | s |
| 21 | Re | Grid equivalent resistance | pu |
| 22 | Xe | Grid equivalent reactance | pu |
| 23 | CM1 | LVRT control mode flag | |
| 24 | kRCI | Reactive current injection gain (LVRT) | |
| 25 | kRCA | Reactive current absorption gain (HVRT) | |
| 26 | m | Active-reactive current priority parameter | |
| 27 | n | Active-reactive current priority parameter | |
| 28 | dbmin | Frequency deadband lower limit | pu |
| 29 | dbmax | Frequency deadband upper limit | pu |
| 30 | HVRT | HVRT flag | |
| 31 | LVRT | LVRT flag | |
| 32 | CM2 | Control mode 2 flag | |
| 33 | Vtrip | Trip voltage threshold | pu |
State Variables
Section titled “State Variables”| Variable | Description |
|---|---|
vxl, vyl | Filtered terminal voltage components |
Vt | Terminal voltage magnitude |
PLLPhaseAngle | PLL phase angle |
Vm | Voltage magnitude measurement |
Ip, Iq | Active and reactive current outputs |
Ipcmd, Iqcmd | Current commands |
Iqmax, Iqmin | Reactive current limits |
Ipmax, Ipmin | Active current limits |
DeltaW, DeltaWf | Frequency deviation and filtered value |
Pgen, Qgen | Generated active and reactive power |
Usage Example
Section titled “Usage Example”INJEC IBG IBG1 BUS_GEN 1. 1. 0. 0. 1.2 1.0 0.5 0.02 0.01 0.5 1.0 0.05 1.1 20.0 0.1 2.0 0.1 0.5 0.95 1.05 0.0 2.0 1.0 1.0 0.0 0.05 1 2.0 1.5 2.0 2.0 -0.02 0.02 1 1 1 0.85 ;WT3 (inj_WT3): Type 3 Wind Turbine (DFIG)
Section titled “WT3 (inj_WT3): Type 3 Wind Turbine (DFIG)”The data-file model name is WT3 (or inj_WT3).
Description
Section titled “Description”A Type 3 wind turbine model implementing the WECC composite structure with four coupled sub-models:
- REPC_A: Plant-level controller (reactive power / voltage regulation, frequency response)
- REEC_A: Electrical controller (inner - current control, LVRT/HVRT logic)
- WTGTRQ_A: Generator torque controller (rotor speed regulation via electrical torque command)
- WTGPT_A: Pitch controller (aerodynamic power limitation)
- WTGAR_A: Aerodynamic rotor model
- WTGT_A: Two-mass mechanical drivetrain (turbine inertia , generator inertia , shaft stiffness , damping )
The doubly-fed induction generator (DFIG) topology allows decoupled control of active and reactive power via rotor-side converter injection.
Scientific Description
Section titled “Scientific Description”The two-mass drivetrain model governs rotor dynamics:
The torque controller (WTGTRQ_A) uses a piecewise power-speed characteristic:
The electrical controller (REEC_A) provides reactive current injection during voltage dips:
with limiter .
The plant controller (REPC_A) optionally provides frequency response:
Network interface. REGC_A injects a current rather than a voltage behind an impedance. The filtered active and reactive current commands , are resolved into the network frame with the PLL angle and rescaled from the machine rating to the system base:
The PLL angle itself tracks the -axis component of the filtered terminal voltage:
WT4 and BESS use the same interface.
Parameters (selected key parameters)
Section titled “Parameters (selected key parameters)”| # | Name | Sub-model | Description | Unit |
|---|---|---|---|---|
| 1 | SNOM | Nominal power | MW | |
| 2–32 | REPC_A | Plant controller | Reactive/voltage/frequency control | various |
| 33–46 | WTGTRQ_A | Torque ctrl | Speed-torque lookup table, rate limits | various |
| 47–56 | WTGPT_A | Pitch ctrl | Pitch PI gains, angle limits, rate limits | various |
| 57–58 | WTGAR_A | Aero | Aerodynamic gain, initial pitch angle | |
| 59–62 | WTGT_A | Drivetrain | , , , | s, pu |
| 63–97 | REEC_A | Elec ctrl | LVRT/HVRT, current limits, inner PI | various |
| 98+ | REGC_A | Generator | Generator electrical conversion | various |
Full parameter list has 80+ entries; refer to a working example data file for the complete ordering.
Usage Example
Section titled “Usage Example”INJEC WT3 WT3_1 BUS_WIND 1. 1. 0. 0. 100.0 0.0 0.02 0 0.0 0.05 0 0.0 0.3 -0.3 2.0 0.4 0.3 -0.3 0.0 0.15 0.9 0.05 0.0 -0.06 0.06 -0.05 0.05 0.05 -0.05 2.0 1.0 1.0 -1.0 0.02 0 0 0.8 1.5 1.5 0.01 0.5 ... ;WT4 (inj_WT4): Type 4 Wind Turbine (Full Converter)
Section titled “WT4 (inj_WT4): Type 4 Wind Turbine (Full Converter)”The data-file model name is WT4 (or inj_WT4).
Description
Section titled “Description”A Type 4 wind turbine with full-rated converter. Unlike Type 3, the generator is fully decoupled from the grid through a back-to-back converter. The model implements the same WECC framework as WT3 but without the doubly-fed rotor circuit: the mechanical sub-model is a single-mass (or two-mass) drive train, and all electrical power passes through the converter. Sub-models include REPC_A (plant controller), REEC_A (electrical controller), WTGT_A (drivetrain), and REGC_A (generator/converter).
Scientific Description
Section titled “Scientific Description”The two-mass drivetrain is identical to WT3:
There is no pitch controller or aerodynamic rotor in the basic Type 4 configuration; the active power reference is supplied directly (or from REPC_A), and rate limits dPmax/dPmin apply to the power order ramp.
The REEC_A electrical controller supplies current commands with the same LVRT/HVRT logic as WT3, with current limits through the converter lookup table (piecewise linear in voltage: for active current and for reactive).
Parameters (selected key parameters)
Section titled “Parameters (selected key parameters)”| # | Name | Sub-model | Description | Unit |
|---|---|---|---|---|
| 1 | SNOM | Nominal power | MW | |
| 2–32 | REPC_A | Plant ctrl | Same as WT3 | various |
| 33–37 | WTGT_A | Drivetrain | , , , , | s, pu |
| 38–80 | REEC_A | Elec ctrl | LVRT, current limits, PI gains | various |
| 81+ | REGC_A | Generator | Converter electrical model | various |
Usage Example
Section titled “Usage Example”INJEC WT4 WT4_1 BUS_WIND 1. 1. 0. 0. 100.0 0.0 0.02 0 0.0 0.05 0 0.0 0.3 -0.3 2.0 0.4 0.3 -0.3 0.0 0.15 0.9 0.05 0.0 -0.06 0.06 -0.05 0.05 0.05 -0.05 2.0 1.0 1.0 -1.0 0.02 0 0 5.0 1.5 1.0 1.5 20.0 ... ;PV (inj_PV): Photovoltaic Generator
Section titled “PV (inj_PV): Photovoltaic Generator”The data-file model name is PV (or inj_PV).
Description
Section titled “Description”A photovoltaic generator model with similar WECC-derived structure to the wind turbine models. The model includes a plant controller (voltage/reactive power regulation), an electrical controller (current limits, LVRT), and generator/converter representation. Unlike wind turbines, there is no mechanical drive train; the active power set-point follows an irradiance input or a fixed reference. LVRT/HVRT logic and current limiting are identical to the Type 4 wind model.
Scientific Description
Section titled “Scientific Description”The PV generator delivers active and reactive power through current commands:
subject to the constraint . The inner current loop is a first-order filter:
Low-voltage power-logic (LVPL) limits active current during deep voltage sags via a piecewise-linear function of with breakpoints lvpnt0, lvpnt1, Lvpl1. HVRT and LVRT timers control disconnection and reconnection.
Parameters (selected)
Section titled “Parameters (selected)”| # | Name | Description | Unit |
|---|---|---|---|
| 1 | Imax | Maximum converter current | pu |
| 2 | IN | Nominal current | pu |
| 3 | ratemax | Reconnection ramp rate | pu/s |
| 4 | Tg | Active current filter time constant | s |
| 5 | Tm | Reactive current filter time constant | s |
| 6–9 | LVRT timers | tLVRT1, tLVRT2, tLVRTint, Vmax | s, pu |
| 10 | kpll | PLL gain | |
| 11 | Vminpll | PLL freeze voltage | pu |
| 12–14 | LVRT curve | a, Vmin, Vint | |
| 21–22 | Re, Xe | Grid equivalent impedance | pu |
| 23–29 | Current control | CM1, kRCI, kRCA, m, n, dbmin, dbmax | |
| 34 | BM | Battery module flag |
Usage Example
Section titled “Usage Example”INJEC PV PV1 BUS_PV 1. 1. 0. 0. 1.2 1.0 0.5 0.02 0.01 0.5 1.0 0.05 1.1 20.0 0.1 2.0 0.1 0.5 0.95 1.05 0.0 2.0 1.0 1.0 0.0 0.05 1 2.0 1.5 2.0 2.0 -0.02 0.02 1 1 1 0.85 0 ;GFOR (inj_GFOR): Grid-Forming Converter (VSM)
Section titled “GFOR (inj_GFOR): Grid-Forming Converter (VSM)”The data-file model name is GFOR (or inj_GFOR).
Description
Section titled “Description”A grid-forming voltage source converter implementing Virtual Synchronous Machine (VSM) dynamics, modelled under the phasor approximation. The converter is an MMC-type VSC connected to the grid through its transformer (no LC filter); the DC side is not modelled (the DC voltage is assumed constant) so the focus is on the AC grid dynamics.
The modulated voltage magnitude is held at its setpoint in normal operation, while the phase angle is driven by a synthetic swing equation with inertia emulation () and oscillation damping () against a PLL estimate of the grid frequency. Participation in primary frequency control is optional, through the droop . Overcurrents are limited by proportionally scaling the - current vector back to the circle with a small time constant.
Scientific Description
Section titled “Scientific Description”Reference frame. The axis is attached to the internal phase angle of the modulated voltage. Voltages and currents at the point of common coupling are transformed as:
with the analogous transformation for the converter-side currents , , where converts to per-unit on the converter base.
Transformer. The voltage-current relationship across the connection transformer (resistance , inductance , ideal ratio ) in the - frame is:
PLL. The PLL only serves to estimate the grid angular frequency for the damping term. It is the same model as in the grid-following converter (see the PLL diagram there), with PI gains derived from the time constant :
The PLL is frozen (hysteresis) when the PCC voltage falls below 0.4 pu and reactivated when it recovers above 0.5 pu (fixed thresholds in this model).
Active power and phase angle control (VSM).
where is the active power setpoint and is the virtual power computed from the unsaturated currents:
equals the actual active power when the current is not limited, and yields improved large-disturbance stability while the current is limited (the angle dynamics do not wind up).
Current limitation. The currents that would result from normal voltage control (i.e. , ) are first determined from:
The current overload ratio is passed through a first-order lag with time constant (typically 1 ms) and a non-windup lower limit of 1, giving . Both current components are then decreased in the same proportion:
and the modulated voltage is set to the value that yields the saturated currents:
When : , the currents are unsaturated, and , .
Parameters
Section titled “Parameters”Default values correspond to a 1100 MVA converter. Per-unit values refer to the nominal apparent power of the converter.
| # | Name | Description | Unit | Default |
|---|---|---|---|---|
| 1 | R | Resistance of connection transformer | pu | 0.005 |
| 2 | L | Inductance of connection transformer | pu | 0.15 |
| 3 | r | Ratio of ideal transformer | 1.02 | |
| 4 | Snom | Nominal apparent power | MVA | 1100 |
| 5 | H | Inertia constant | s | 5.0 |
| 6 | D | Damping constant of virtual synchronous machine | 300 | |
| 7 | Tpll | Time constant of PLL | s | 0.1 |
| 8 | Rdroop | Droop of primary frequency control | pu | 999 |
| 9 | Imax | Maximum current (typically 1–1.2) | pu | 1.0 |
| 10 | Te | Time constant of current saturation | s | 0.001 |
A very large Rdroop (e.g. 999) effectively disables participation in primary frequency control.
Five additional parameters are computed at initialization from the power-flow solution: k (current conversion factor), vmx0, vmy0 (components of the initial modulated voltage), Vmo (its magnitude , i.e. the voltage setpoint) and Po (the active power setpoint , pu on Snom base). Vmo and Po can be modified during the simulation with CHGPRM disturbances to change the voltage and active power setpoints.
State Variables
Section titled “State Variables”The model has 33 states (2 output currents + 31 internal). Key internal states:
| Variable | Description | Unit |
|---|---|---|
wref | Angular speed of reference axes | pu |
ixt, iyt | Converter-side currents (on Snom base) | pu |
Vm, deltam | Modulated voltage magnitude and phase angle | pu, rad |
V | Voltage magnitude at PCC | pu |
mult_pll | PLL freezing factor (hysteresis output) | |
w_pll, theta_pll | PLL frequency and angle estimates | pu, rad |
P, Pvirt | Active power and virtual power (on Snom base) | pu |
omegam | Angular frequency of modulated voltage | pu |
vd, vq, id, iq | PCC voltage and current in - frame | pu |
id*, iq* | Unsaturated currents | pu |
id*s, iq*s | Saturated currents | pu |
rho, rhos | Current overload ratio and its saturated value | |
Q | Reactive power (on Snom base) | pu |
Observables: P, Pvirt, Q, Vm, vmd, vmq, deltam, omegam, w_pll, I, id, id*, id*s, iq, iq*, iq*s, rho, rhos.
Usage Example
Section titled “Usage Example”A 1100 MVA grid-forming converter:
# name bus FP FQ P Q R L r Snom H D Tpll Rdroop Imax TeINJEC GFOR HVDC A 1. 1. 0. 0. 0.005 0.15 1.02 1100. 5.0 300. 0.100 999. 1.0 0.001 ;GFOL (inj_GFOL): Grid-Following Converter
Section titled “GFOL (inj_GFOL): Grid-Following Converter”The data-file model name is GFOL (or inj_GFOL).
Description
Section titled “Description”A grid-following voltage source converter modelled under the phasor approximation. As for the grid-forming model, the converter is an MMC-type VSC connected through its transformer (no LC filter) and the DC side is not modelled. The model is rather detailed: it includes measurement low-pass filters, a PLL with blocking/unblocking hysteresis, outer active power and voltage/reactive power control loops, inner - current control loops, a rate-limited -axis current limit with priority to the reactive current, and a piecewise-linear dynamic voltage support characteristic.
Scientific Description
Section titled “Scientific Description”Reference frame. The VSC control frame tracks the PCC voltage phasor through the PLL angle (state theta_pll):
with the analogous transformation for the converter-side currents (, ). In steady state and .
Phase Locked Loop.
The -axis voltage error drives a PI controller whose output is the grid frequency estimate (state w_pll); integrating gives the PLL angle. The PI gains follow from the PLL response time :
The PLL is blocked once the PCC voltage falls below Vpllb and reactivated once recovers above Vpllu (hysteresis).
Inner current control.
combined with the transformer voltage-current relationship in the - frame:
Active power control.
The measured active power is filtered with time constant and compared with the setpoint ; a PI controller (, ) with non-windup limits produces . The limit gives priority to the reactive current:
and tracks this static value through a first-order lag (, typically 0.002 s) with rate limits dPdt_min/dPdt_max, limiting in particular the rate of recovery of the active current after it has been decreased by an increase of .
Voltage / reactive power control.
Depending on vqswitch, either the compensated voltage or the reactive power is controlled:
The controlled quantity is filtered () and its deviation from setpoint drives a PI controller (, ) with non-windup limits , giving the component . The error is zeroed (controller frozen) while . A second component implements dynamic voltage support as a piecewise-linear function of : zero above , decreasing linearly to at , constant below. The total , limited to , is the reactive current reference .
With , and , controlling amounts to controlling the magnitude of the modulated voltage.
Parameters
Section titled “Parameters”Default values correspond to a 1200 MVA converter. Per-unit values refer to the nominal apparent power of the converter.
| # | Name | Description | Unit | Default |
|---|---|---|---|---|
| 1 | R | Phase reactor resistance | pu | 0.005 |
| 2 | L | Phase reactor inductance | pu | 0.15 |
| 3 | r | Ratio of ideal transformer | 1.02 | |
| 4 | Snom | Nominal apparent power | MVA | 1200 |
| 5 | Rc | Resistance used in compensated voltage | pu | 0.005 |
| 6 | Xc | Reactance used in compensated voltage | pu | 0.15 |
| 7 | Kp | Current control: proportional gain | 0.573 | |
| 8 | Ki | Current control: integral gain | 6.0 | |
| 9 | Tlpf | Measurement time constant (low-pass filter) | s | 0.0033 |
| 10 | Kpp | Active power control: proportional gain | 0.0333 | |
| 11 | Kip | Active power control: integral gain | 10.0 | |
| 12 | Trlim | Time constant of the rate limiter | s | 0.002 |
| 13 | dPdt_min | Min rate of change of the -current limit | pu/s | -999 |
| 14 | dPdt_max | Max rate of change of the -current limit | pu/s | 10.0 |
| 15 | Kpv | Reactive power control: proportional gain | 0.1667 | |
| 16 | Kiv | Reactive power control: integral gain | 50.0 | |
| 17 | tau | Response time of PLL | s | 0.10 |
| 18 | Vpllb | Voltage below which the PLL is blocked | pu | 0.4 |
| 19 | Vpllu | Voltage above which the PLL is unblocked | pu | 0.5 |
| 20 | Imax | Maximum current (typically 1–1.2) | pu | 1.0 |
| 21 | Vs1 | Voltage below which dynamic reactive support starts | pu | -1000 |
| 22 | Vs2 | Voltage at which reactive support is maximum () | pu | -2000 |
| 23 | iqmax | Limit (±) on quadrature current component | pu | 1.001 |
| 24 | vqswitch | 1 = voltage control, 0 = reactive power control | flag | 1 |
Setting Vs1 and Vs2 to large negative values (as in the defaults above) disables the dynamic voltage support; a more elaborate control is recommended for that function. Typical values of Kiv are 50 pu/s for voltage control and 10 pu/s for reactive power control.
Six additional parameters are computed at initialization from the power-flow solution: k (current conversion factor), P0, Q0 (active/reactive power setpoints, pu on Snom base), Vc0 (compensated voltage setpoint), Imin and iq1max (). P0, Q0 and Vc0 can be modified during the simulation with CHGPRM disturbances.
State Variables
Section titled “State Variables”The model has 52 states (2 output currents + 50 internal). Key internal states:
| Variable | Description | Unit |
|---|---|---|
wref | Angular speed of reference axes | pu |
ixt, iyt | Converter-side currents (on Snom base) | pu |
mult_pll | PLL freezing factor (hysteresis output) | |
w_pll, theta_pll | PLL frequency and angle estimates | pu, rad |
V, vd, vq | PCC voltage magnitude and - components | pu |
id, iq | Converter currents in - frame | pu |
vmd, vmq | Modulated voltage components | pu |
Md, Mq | Current-control PI outputs | pu |
Idmax_stat, Idmax, Idmin | Static / rate-limited / minimum -current limits | pu |
P, Pfil | Active power and its filtered value | pu |
id_pi, idref | Active-power PI output and -current reference | pu |
Vc, Vcfil | Compensated voltage and its filtered value | pu |
Q, Qfil | Reactive power and its filtered value | pu |
mult_V | Voltage/reactive controller freezing factor | |
iq_1, iq_2, iqref | Reactive current components and reference | pu |
Observables: P_MW, Q_Mvar, Vc, Vm, vmd, vmq, I, w_pll, theta_pll_deg, mult_pll, Idmax, Md, idref, id, id_pi, iq_1, iq_2, iqref, iq.
Usage Example
Section titled “Usage Example”A 1200 MVA grid-following converter (record spanning multiple lines):
# name bus FP FQ P Q R L r Snom Rc Xc Kp Ki Tlpf Kpp Kip Trlim dPdt_min dPdt_max Kpv KivINJEC GFOL HVDC1 A 1. 1. 0. 0. 0.005 0.15 1.02 1200. 0.005 0.15 0.5730 6. 0.0033 0.0333 10. 0.002 -999. 10. 0.1667 50.# tau Vpllb Vpllu Imax Vs1 Vs2 iq1max vqswitch 0.10 0.4 0.5 1.000 -1000 -2000 1.001 1 ;Energy Storage
Section titled “Energy Storage”BESS (inj_BESS): Battery Energy Storage System
Section titled “BESS (inj_BESS): Battery Energy Storage System”The data-file model name is BESS (or inj_BESS).
Description
Section titled “Description”A comprehensive BESS model implementing the full WECC framework (REPC_A + REEC_C + REGC_A) plus battery state of charge (SOC) tracking. The model supports both grid-following operation (bidirectional active power dispatch) and reactive power / voltage regulation. It is built on the same REPC_A plant controller as the wind turbine models, and uses the REEC_C converter electrical controller which handles a piecewise-linear -vs- and -vs- characteristic for fault ride-through.
The battery SOC evolves through integration of injected power:
with hard clamps at SOCmin and SOCmax that modify the active power limits Pmax/Pmin dynamically:
Parameters (key parameters)
Section titled “Parameters (key parameters)”| # | Name | Sub-model | Description | Unit |
|---|---|---|---|---|
| 1 | SNOM | Nominal power | MW | |
| 2–32 | REPC_A | Plant controller (same as WT3/WT4) | various | |
| 33–76 | REEC_C | Electrical controller with piecewise , | various | |
| 68 | CapBat | BESS | Battery energy capacity | MWh |
| 69 | SOCini | BESS | Initial state of charge | pu |
| 70 | SOCmax | BESS | Maximum SOC limit | pu |
| 71 | SOCmin | BESS | Minimum SOC limit | pu |
| 72–73 | dPmax, dPmin | BESS | Active power ramp rate limits | pu/s |
| 74–75 | pmax, pmin | REEC_C | Active current limits (pu on SNOM) | pu |
| 76 | Tpord | REEC_C | Active power order time constant | s |
Full parameter listing has approximately 125 parameters; refer to a working example data file for the complete ordering.
State Variables
Section titled “State Variables”The BESS model uses over 40 internal states reflecting the three sub-models. Key states include:
| Variable | Description |
|---|---|
SOC | State of charge |
Pref | Active power reference |
Qext | Reactive power reference from REPC_A |
Ip, Iq | Active/reactive current outputs |
PLLPhaseAngle | PLL phase angle |
Pgen, Qgen | Generated powers |
Usage Example
Section titled “Usage Example”INJEC BESS BESS1 BUS_ST 1. 1. 0. 0. 100.0 0.0 0.02 0 0.0 0.05 0 0.0 0.3 -0.3 2.0 0.4 0.3 -0.3 0.0 0.15 0.9 0.05 0.0 -0.06 0.06 -0.05 0.05 0.05 -0.05 2.0 1.0 1.0 -1.0 0.02 0 0 0.1 0.1 0.02 1.0 0.0 -0.2 0.2 0.2 -0.2 0.6 0.4 0.6 -0.6 1.1 0.9 1.0 0.5 0.01 0.01 0.05 0.9 0.2 0.9 0.1 0.9 -0.1 0.5 -0.5 0.5 -0.5 1.0 -1.0 0.5 -0.5 50.0 0.7 0.9 0.1 5.0 -5.0 1.0 -1.0 0.05 1.1 0.0 2 0.01 ;Reactive Compensation
Section titled “Reactive Compensation”SVC_GENERIC1 (inj_svc_generic1): Generic Static Var Compensator
Section titled “SVC_GENERIC1 (inj_svc_generic1): Generic Static Var Compensator”The data-file model name is SVC_GENERIC1. It takes no prefix.
Description
Section titled “Description”A dynamic SVC injecting a purely reactive current at its bus. A PI voltage
regulator with droop drives a susceptance between Bmin and Bmax,
and two lead-lag stabiliser channels can add a supplementary signal to the
voltage reference. This is the dynamic counterpart of the static
SVC record used by the
power flow: the static record fixes the operating point, this model governs how
the device behaves during the simulation.
The voltage reference is initialised from the power flow solution, so that the model starts in equilibrium:
where is the droop and the initial susceptance implied by the reactive current at the bus.
Parameters
Section titled “Parameters”The record carries 17 data parameters, in order:
| # | Name | Description |
|---|---|---|
| 1 | G1 | Gain of the first stabiliser channel |
| 2 | T1 | Time constant of the first stabiliser channel (s) |
| 3 | a | Lead-lag coefficient of the first channel |
| 4 | K1 | Output gain of the first channel |
| 5 | L1 | Output limit of the first channel (pu) |
| 6 | G2 | Gain of the second stabiliser channel |
| 7 | T2 | Time constant of the second stabiliser channel (s) |
| 8 | b | Lead-lag coefficient of the second channel |
| 9 | K2 | Output gain of the second channel |
| 10 | L2 | Output limit of the second channel (pu) |
| 11 | Ltot | Limit on the summed stabiliser output (pu) |
| 12 | Kp | Proportional gain of the voltage regulator |
| 13 | Ki | Integral gain of the voltage regulator |
| 14 | Bp | Droop, in pu on the SVC base |
| 15 | Bmax | Maximum susceptance (Mvar at 1 pu voltage) |
| 16 | Bmin | Minimum susceptance (Mvar at 1 pu voltage) |
| 17 | Bnom | Susceptance base used for the per-unit conversion (Mvar) |
One additional parameter is computed at initialisation:
| # | Name | Description |
|---|---|---|
| 18 | Vref | Voltage reference, set from the power flow solution |
Observables
Section titled “Observables”Q, dvpss, Bsvc, Vref, Vb
Measurement
Section titled “Measurement”PMU (inj_PMU): Phasor Measurement Unit
Section titled “PMU (inj_PMU): Phasor Measurement Unit”The data-file model name is PMU (or inj_PMU).
Description
Section titled “Description”A measurement-only injector: it injects zero current at its bus and exists
purely to expose bus quantities as observables. It reports a filtered local
frequency estimate computed the same way as the f_inj block, together with the
bus voltage magnitude and angle and the speed and angle of the moving DQ
reference frame. Attach one to any bus whose frequency you want to record
without perturbing the solution.
The frequency estimate is a first-order filter on the bus voltage phasor. The measurement time constant is clamped to a floor of 0.05 s, so values below that have no effect.
Parameters
Section titled “Parameters”| # | Name | Description | Unit |
|---|---|---|---|
| 1 | Tf | Frequency measurement time constant, recommended 0.05 to 0.10; values below 0.05 are clamped | s |
Three additional parameters are set at initialisation: wnom (nominal angular
frequency), vm0 and va0 (the initial bus voltage magnitude and angle).
Observables
Section titled “Observables”| Name | Description | Unit |
|---|---|---|
f | Estimated bus frequency | pu of |
vm | Bus voltage magnitude | pu |
va | Bus voltage phase angle in the moving DQ frame, wrapping at | rad |
thref | Accumulated angle of the DQ reference frame with respect to the nominally rotating frame, zero at | rad |
dwref | Speed deviation of the DQ reference frame from nominal | rad/s |
Usage Example
Section titled “Usage Example”INJEC PMU PMU_1041 1041 0. 0. 0. 0. 0.05 ;All four participation and power fields are zero: the model neither consumes nor produces power.