Component Library
This page documents all the pre-built components available in the PowerDynamics.jl library.
The PowerDynamics.Library component library is currently excluded from semantic versioning and is under heavy development.
While PowerDynamics itself follows semantic versioning, the Library submodule's API is highly unstable and variable names, function signatures, and model interfaces may change frequently without notice. If you are using specific models from PowerDynamics.Library in their current state, we strongly recommend copying them to your own source code to avoid breaking changes in future updates.
Building Blocks
The following building blocks can be used to construct custom control systems and machine models.
Basic Blocks
PowerDynamics.Library.SimpleLag โ Constant
SimpleLag block
โญโโโโโโโโโโฎ
in โ K โ out
โถโโโโคโถโโโโโโโโดโโโโโโด
โ 1 + s T โ
โฐโโโโโโโโโโฏAdditional structural parameters:
guess=0/default: initial guess/default for the internal state (equals output in steady state)allowzeroT: if true, the lag is bypassed when T=0 (this does not reduce the model order)
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.SimpleLead โ Constant
SimpleLead block
โญโโโโโโโโโโฎ
in โ 1 + s T โ out
โถโโโโคโถโโโโโโโโดโโโโโโด
โ K โ
โฐโโโโโโโโโโฏThis block directly uses Dt(in), therefore it does not add additional states but may not be used in all scenarios!
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.LeadLag โ Constant
LeadLag block
โญโโโโโโโโโโโฎ
in โ 1 + sT1 โ out
โถโโโโคKโถโโโโโโโโดโโโโโโด
โ 1 + sT2 โ
โฐโโโโโโโโโโโฏAdditional structural parameters:
guess=0: initial guess for the internal state (equals input in steady state)allowzeroT: if true, the lead-lag is bypassed when T1=0 and T2=0 (this does not reduce the model order)
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.Derivative โ Constant
Derivative approximation block. Modeled after Modelica.Blocks.Continuous.Derivative
โญโโโโโโโโโโฎ
in โ s K โ out
โถโโโโคโถโโโโโโโโดโโโโโโด
โ 1 + s T โ
โฐโโโโโโโโโโฏAdditional structural parameters:
guess=0: initial guess for the internal state (equals input in steady state)
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.SimpleGain โ Constant
Simple gain block
in โญโโโโฎ out
โถโโโโค K โโโโโโด
โฐโโโโฏFor a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.SimpleLagLim โ Function
SimpleLagLim block
__ outMax
/
โญโโโโโโโโโโฎ
in โ K โ out
โถโโโโคโถโโโโโโโโดโโโโโโด
โ 1 + s T โ
โฐโโโโโโโโโโฏ
outMin __/Additional structural parameters:
guess=0: initial guess for the internal state (equals output in steady state)
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.LimIntegrator โ Function
LimIntegrator block
__ outMax
/
โญโโโโโโฎ
in โ K โ out
โถโโโโคโถโโโโดโโโโโโด
โ s T โ
โฐโโโโโโฏ
outMin __/Additional structural parameters:
guess=0: initial guess for the internal state (equals output in steady state)
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.DeadZone โ Constant
DeadZone block, modeled after Modelica.Blocks.Nonlinear.DeadZone
โ โฑ
uMin โ โฑ
โโโโโโผโผโโฟโโพโผโโโโโ
โฑ โ uMax
โฑ โA dead zone nonlinearity that outputs zero when the input is within the specified band [uMin, uMax].
- If
in < uMin:out = in - uMin(negative linear) - If
uMin โค in โค uMax:out = 0(dead zone) - If
in > uMax:out = in - uMax(positive linear)
Structural parameters:
uMax: Upper dead zone limituMin=-uMax: Lower dead zone limit (defaults to -uMax for symmetric dead zone)
For a concrete list of variables and parameters please check the model source on GitHub.
Utility Functions
PowerDynamics.Library.ss_to_mtkmodel โ Function
ss_to_mtkmodel(A, B, C, D; name=nothing, guesses=zeros(size(A,1)))Convert a state-space representation to a ModelingToolkit model.
Matrices can be either of real numbers or symbolic parameters/terms.
Returns A System object with variables in (input), out (output), and xโ, xโ, ... (states).
PowerDynamics.Library.siso_tf_to_ss โ Function
siso_tf_to_ss(num, den)Convert a SISO transfer function to state-space representation.
Takes polynomial coefficients for numerator and denominator and returns state-space matrices (A, B, C, D). The transfer function is represented as:
num[1]sโฟ + num[2]sโฟโปยน + ... + num[end]
G(s) = โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
den[1]sแต + den[2]sแตโปยน + ... + den[end]Arguments
num: Vector of numerator coefficients (highest degree first)den: Vector of denominator coefficients (highest degree first)
Returns
A tuple (A, B, C, D) of state-space matrices in controller canonical form.
Notes
- Leading zeros in num/den are automatically truncated
- Transfer function must be proper (numerator degree โค denominator degree)
- Adapted from SymbolicControlSystems.jl (Copyright (c) 2020 Fredrik Bagge Carlson, MIT License)
Saturation Functions
PowerDynamics.Library.QUAD_SE โ Function
QUAD_SE(u, SE1, SE2, E1, E2)Quadratic Saturation Function through two points (E1,SE1) and (E2,SE2).
PowerDynamics.Library.EXP_SE โ Function
EXP_SE(u, SE1, SE2, E1, E2)Exponential Saturation Function through two points (E1,SE1) and (E2,SE2).
Slack Models
Algebraic and Differential Slack
PowerDynamics.Library.SlackAlgebraic โ Constant
SlackAlgebraicAlgebraic slack bus that enforces constant real and imaginary voltage components.
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.SlackDifferential โ Constant
SlackDifferentialSlack bus with differential voltage states, holding voltage constant via zero derivatives.
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.VariableFrequencySlack โ Constant
VariableFrequencySlackSlack bus with a dynamic voltage angle driven by a configurable (possibly time-varying) frequency.
For a concrete list of variables and parameters please check the model source on GitHub.
Machine Models
Synchronous Machine Models
PowerDynamics.Library.PSSE_GENCLS โ Constant
PSSE_GENCLSThis model is a port of the OpenIPSL Electrical.Machines.PSSE.GENCLS model, maintaining the same mathematical formulation while adapting to PowerDynamics/ModelingToolkit conventions.
Validation
Validated against the OpenIPSL SMIB testcase Tests.Machines.PSSE.GENCLS. See validation plot generated by automatic validation script in /test/OpenIPSL_test.
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.PSSE_GENROU โ Function
PSSE_GENROUThis model is a port of the OpenIPSL Electrical.Machines.PSSE.GENROU model, maintaining the same mathematical formulation while adapting to PowerDynamics/ModelingToolkit conventions.
Validation
Validated against the OpenIPSL SMIB testcase Tests.Machines.PSSE.GENROU. See validation plot generated by automatic validation script in /test/OpenIPSL_test.
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.PSSE_GENROE โ Function
PSSE_GENROEThis model is a port of the OpenIPSL Electrical.Machines.PSSE.GENROE model, maintaining the same mathematical formulation while adapting to PowerDynamics/ModelingToolkit conventions.
Validation
Validated against the OpenIPSL SMIB testcase Tests.Machines.PSSE.GENROE. See validation plot generated by automatic validation script in /test/OpenIPSL_test.
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.PSSE_GENSAL โ Function
PSSE_GENSALThis model is a port of the OpenIPSL Electrical.Machines.PSSE.GENSAL model, maintaining the same mathematical formulation while adapting to PowerDynamics/ModelingToolkit conventions.
Validation
Validated against the OpenIPSL SMIB testcase Tests.Machines.PSSE.GENSAL. See validation plot generated by automatic validation script in /test/OpenIPSL_test.
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.PSSE_GENSAE โ Function
PSSE_GENSAEThis model is a port of the OpenIPSL Electrical.Machines.PSSE.GENSAE model, maintaining the same mathematical formulation while adapting to PowerDynamics/ModelingToolkit conventions.
Validation
Validated against the OpenIPSL SMIB testcase Tests.Machines.PSSE.GENSAE. See validation plot generated by automatic validation script in /test/OpenIPSL_test.
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.SauerPaiMachine โ Constant
SauerPaiMachineMachine Model as described in the book of Sauer and Pai.
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.Swing โ Constant
SwingSimplified swing-equation generator with constant voltage magnitude and active power balance.
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.ClassicalMachine โ Constant
ClassicalMachineClassical synchronous machine model with transient reactance and swing dynamics.
For a concrete list of variables and parameters please check the model source on GitHub.
Control Systems
Exciters & AVRs
PowerDynamics.Library.PSSE_EXST1 โ Constant
PSSE_EXST1This model is a port of the OpenIPSL Electrical.Controls.PSSE.ES.EXST1 model, maintaining the same mathematical formulation while adapting to PowerDynamics/ModelingToolkit conventions.
Validation
Validated against the OpenIPSL SMIB testcase Tests.Controls.PSSE.ES.EXST1. See validation plot generated by automatic validation script in /test/OpenIPSL_test.
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.PSSE_ESST4B โ Constant
PSSE_ESST4BThis model is a port of the OpenIPSL Electrical.Controls.PSSE.ES.ESST4B model, maintaining the same mathematical formulation while adapting to PowerDynamics/ModelingToolkit conventions.
Validation
Validated against the OpenIPSL SMIB testcase Tests.Controls.PSSE.ES.ESST4B. See validation plot generated by automatic validation script in /test/OpenIPSL_test.
There are still some slight deviations, likely due to differences in the initialization/steady state (see the current integrator state in the validation plot).
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.PSSE_ESST1A โ Constant
PSSE_ESST1AThis model is a port of the OpenIPSL Electrical.Controls.PSSE.ES.ESST1A model, maintaining the same mathematical formulation while adapting to PowerDynamics/ModelingToolkit conventions.
Validation
Validated against the OpenIPSL SMIB testcase Tests.Controls.PSSE.ES.ESST1A. See validation plot generated by automatic validation script in /test/OpenIPSL_test.
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.PSSE_SCRX โ Constant
PSSE_SCRXThis model is a port of the OpenIPSL Electrical.Controls.PSSE.ES.SCRX model, maintaining the same mathematical formulation while adapting to PowerDynamics/ModelingToolkit conventions.
Validation
Validated against the OpenIPSL SMIB testcase Tests.Controls.PSSE.ES.SCRX. See validation plot generated by automatic validation script in /test/OpenIPSL_test.
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.PSSE_IEEET1 โ Constant
PSSE_IEEET1This model is a port of the OpenIPSL Electrical.Controls.PSSE.ES.IEEET1 model, maintaining the same mathematical formulation while adapting to PowerDynamics/ModelingToolkit conventions.
Validation
Validated against the OpenIPSL SMIB testcase Tests.Controls.PSSE.ES.IEEET1. See validation plot generated by automatic validation script in /test/OpenIPSL_test.
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.AVRFixed โ Constant
AVRFixedTrivial AVR that holds the field voltage at a fixed parameter value.
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.AVRTypeI โ Constant
AVRTypeIIEEE Type I excitation system with amplifier, stabilizer feedback, field circuit, and ceiling function.
For a concrete list of variables and parameters please check the model source on GitHub.
Governors and Turbines
PowerDynamics.Library.PSSE_IEEEG1 โ Constant
PSSE_IEEEG1This model is a port of the OpenIPSL Electrical.Controls.PSSE.TG.IEEEG1 model, maintaining the same mathematical formulation while adapting to PowerDynamics/ModelingToolkit conventions.
Validation
Validated against the OpenIPSL SMIB testcase Tests.Controls.PSSE.TG.IEEEG1. See validation plot generated by automatic validation script in /test/OpenIPSL_test.
There are still some slight deviations, likely due to differences in the initialization/steady state (see P_MECH output of the validation plot).
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.PSSE_HYGOV โ Constant
PSSE_HYGOVThis model is a port of the OpenIPSL Electrical.Controls.PSSE.TG.HYGOV model, maintaining the same mathematical formulation while adapting to PowerDynamics/ModelingToolkit conventions.
Validation
Validated against the OpenIPSL SMIB testcase Tests.Controls.PSSE.TG.HYGOV. See validation plot generated by automatic validation script in /test/OpenIPSL_test.
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.GovFixed โ Constant
GovFixedTrivial governor that holds the mechanical torque at a fixed parameter value.
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.TurbineGovTypeI โ Constant
TurbineGovTypeIType-I turbine governor with droop, servo, and transient gain reduction stages (Milano p. 359).
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.TGOV1 โ Constant
TGOV1TGOV1 steam turbine governor with droop, valve limiter, and reheater.
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.PSSE_GGOV1_EXPERIMENTAL โ Constant
PSSE_GGOV1_EXPERIMENTALThis model is a port of the OpenIPSL Electrical.Controls.PSSE.TG.GGOV1 model, maintaining the same mathematical formulation while adapting to PowerDynamics/ModelingToolkit conventions.
Validation
This model does not support delay! It is validaded against a modified version of the OpenIPSL SMIB testcase Tests.Controls.PSSE.TG.GGOV1 without delay (see reference data generation script in /test/OpenIPSL/GGOV1 for modified version). Also, the OpenIPSL testcase does not start in a steady state, so we have some deviation in the validation still. See validation plot generated by automatic validation script in /test/OpenIPSL_test.
For a concrete list of variables and parameters please check the model source on GitHub.
Power System Stabilizers (PSS)
PowerDynamics.Library.PSSE_IEEEST โ Constant
PSSE_IEEESTThis model is a port of the OpenIPSL Electrical.Controls.PSSE.PSS.IEEEST model, maintaining the same mathematical formulation while adapting to PowerDynamics/ModelingToolkit conventions.
Validation
Validated against the OpenIPSL SMIB testcase Tests.Controls.PSSE.PSS.IEEEST. See validation plot generated by automatic validation script in /test/OpenIPSL_test.
For a concrete list of variables and parameters please check the model source on GitHub.
Load Models
Static Load Models
PowerDynamics.Library.PQLoad โ Constant
PQLoadConstant-power load that draws fixed active and reactive power regardless of voltage.
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.VoltageDependentLoad โ Constant
VoltageDependentLoadLoad whose active and reactive power scale as a polynomial function of voltage magnitude.
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.ConstantYLoad โ Constant
ConstantYLoadConstant-admittance (shunt Y) load drawing current proportional to the bus voltage.
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.ZIPLoad โ Constant
ZIPLoadZIP load combining constant-impedance, constant-current, and constant-power fractions.
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.ConstantCurrentLoad โ Constant
ConstantCurrentLoadConstant-current load drawing a fixed current magnitude at a configurable phase offset relative to the bus voltage.
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.PSSE_Load โ Constant
PSSE_LoadPSS/E load model combining ZIP (constant-impedance/current/power) characteristics with voltage-dependent scaling.
For a concrete list of variables and parameters please check the model source on GitHub.
Line Models
Transmission Line Models
PowerDynamics.Library.PiLine โ Constant
PiLinePi-section transmission branch with series impedance, shunt admittances, and optional transformer ratios.
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.PiLine_fault โ Constant
PiLine_faultPi-section branch with a configurable mid-point fault (short-circuit or impedance-to-ground).
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.Breaker โ Constant
BreakerIdeal circuit breaker: enforces equal terminal voltages when closed, zero current when open.
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.DynamicSeriesRLBranch โ Constant
DynamicSeriesRLBranch(; R, L, ฯ0, r_src=1, r_dst=1)Dynamic transmission line modeled as a series R-L circuit with optional transformer ratios.
This model represents a series resistance and inductance connecting two buses. The line current is a differential state, suitable for:
- Transmission lines with significant inductive reactance
- Transformer models with leakage impedance
- Dynamic analysis requiring explicit current dynamics
Parameters
R: Line resistance [pu]L: Line reactance [pu] at frequency ฯ0. Related to physical inductance by L = ฯ0 * L_actual.ฯ0: Frame angular frequency [rad/s]. Default: 2ฯ*50 rad/s.r_src: Transformer voltage ratio at source. Default: 1.r_dst: Transformer voltage ratio at destination. Default: 1.
For a concrete list of variables and parameters please check the model source on GitHub.
Shunt Models
Static and Dynamic Shunts
PowerDynamics.Library.StaticShunt โ Constant
StaticShunt(; G, B)Static (algebraic) shunt element with constant admittance Y = G + jB.
This model represents a linear shunt connected to a bus, drawing current proportional to the bus voltage: I = Y * V. It has no dynamic states and is evaluated algebraically.
Parameters
G: Shunt conductance [pu]. Positive values represent resistive losses (real power consumption).B: Shunt susceptance [pu]. Positive values represent capacitive behavior (leading current), negative values represent inductive behavior (lagging current).
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.DynamicCShunt โ Constant
DynamicCShunt(; C, ฯ0=2ฯ*50)Dynamic shunt element modeled as a pure capacitor.
The capacitor voltage is a differential state, suitable for DAE index reduction at current-source buses and modelling shunt capacitor banks without resistive losses.
Parameters
C: Shunt susceptance [pu] at frequency ฯ0. Related to physical capacitance by C = ฯ0 * C_actual.ฯ0: Frame angular frequency [rad/s]. Default: 2ฯ*50 rad/s.
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.DynamicParallelRCShunt โ Constant
DynamicParallelRCShunt(; R, C, ฯ0=2ฯ*50)Dynamic shunt element modeled as a parallel R โฅ C circuit.
This model represents a parallel combination of resistance and capacitance connected to a bus. The capacitor voltage is a differential state, suitable for:
- Shunt capacitor banks with resistive losses
- Dynamic susceptance for DAE index reduction at current-source buses
- Fast transient behavior of reactive compensation
Parameters
R: Shunt resistance [pu]C: Shunt susceptance [pu] at frequency ฯ0. Related to physical capacitance by C = ฯ0 * C_actual.ฯ0: Frame angular frequency [rad/s]. Default: 2ฯ*50 rad/s.
For a concrete list of variables and parameters please check the model source on GitHub.
Renewable Energy Models
Inverter Models
PowerDynamics.Library.IdealDroopInverter โ Constant
IdealDroopInverterSimplified droop-controlled inverter with first-order power filtering and ideal voltage source output.
For a concrete list of variables and parameters please check the model source on GitHub.
Composable Inverter Modeling
The ComposableInverter module within library provides common inverter models using cascaded controls over L, LC or LCL filters in a "component based" way.
Toplevel Models
PowerDynamics.Library.ComposableInverter.DroopInverter โ Function
DroopInverter(; name=:droop_inv, filter_type, defaults...)Grid-forming inverter with droop control for frequency and voltage regulation.
Wraps VoltageSource with DroopOuter controller implementing P-f and Q-V droop characteristics. Suitable for:
- Grid-forming inverters in microgrids
- Virtual synchronous machine (VSM) implementations
- Parallel inverter operation with power sharing
Parameters
filter_type::LCor:LCLfilter topology (passed to VoltageSource)- Droop controller parameters:
Kp(P-f droop),Kq(Q-V droop),ฯ_p,ฯ_q(power filter time constants) - Filter parameters inherited from VoltageSource:
Lf,C,Lg,ฯ0 defaults...: Additional parameter/variable defaults (e.g.,Kp=0.5, ฯ_p=0.2)
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.ComposableInverter.SimpleGFL โ Function
SimpleGFL(; name, iset_input=false, defaults...)Simplified grid-following inverter with L-filter, current control, and PLL.
Implements single-loop current control (CC1) with PLL synchronization and simple L-filter. Suitable for:
- Basic grid-following inverter models
- Simplified renewable energy source representation
- Studies where detailed filter dynamics are not critical
Parameters
iset_input: If true, current setpoint comes from RealInput ports. If false, uses internal isetd/isetq parameters.Lf: Filter reactance [pu]. Related to physical inductance by Lf = ฯ0 * Lf_actual.ฯ0: Frame angular frequency [rad/s]. Default: 2ฯ*50 rad/s.- PLL and CC1 controller gains
defaults...: Additional parameter/variable defaults (e.g.,Lf=0.05, PLL_Kp=50)
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.ComposableInverter.SimpleGFLDC โ Function
SimpleGFLDC(; name, defaults...)Grid-following inverter with DC-link dynamics and active power control.
Extends SimpleGFL with DC-link capacitor model and PI controller for DC voltage regulation. The DC voltage controller generates active current reference (q-axis). Suitable for:
- Inverters with significant DC-link capacitance
- Renewable sources with DC power input (solar PV, battery storage)
- Studies requiring DC-side transient analysis
Parameters
Lf: Filter reactance [pu]. Related to physical inductance by Lf = ฯ0 * Lf_actual.ฯ0: Frame angular frequency [rad/s]. Default: 2ฯ*50 rad/s.C_dc: DC-link capacitance [pu]V_dc: DC voltage reference [pu]kp_v_dc,ki_v_dc: DC voltage PI controller gainsP_dc: External DC power draw [pu]- PLL and CC1 controller gains
defaults...: Additional parameter/variable defaults (e.g.,Lf=0.03, V_dc=2.0)
For a concrete list of variables and parameters please check the model source on GitHub.
Building Blocks
PowerDynamics.Library.ComposableInverter.VoltageSource โ Function
VoltageSource(; name, Vset_input=false, filter_type=:LC, defaults...)Grid-forming voltage source inverter with cascaded voltage and current control.
Implements two-loop control with voltage controller (VC) commanding current references to inner current controller (CC1). Operates in a fixed dq-frame (no PLL). Suitable for:
- Grid-forming inverters establishing voltage and frequency
- Islanded or weak-grid operation
- Droop-controlled systems (via DroopInverter wrapper)
Parameters
Vset_input: If true, voltage setpoint comes from RealInput ports. If false, uses internal Vset/ฮดset parameters.filter_type::LCfor LC filter or:LCLfor LCL filter.Lf: Inverter-side filter reactance [pu]. Related to physical inductance by Lf = ฯ0 * Lf_actual.C: Filter susceptance [pu]. Related to physical capacitance by C = ฯ0 * C_actual.Lg: Grid-side filter reactance [pu]. Related to physical inductance by Lg = ฯ0 * Lg_actual (LCL only).ฯ0: Frame angular frequency [rad/s]. Default: 2ฯ*50 rad/s.- Various PI controller gains (CC1KP, CC1KI, VCKP, VCKI)
defaults...: Additional parameter/variable defaults (e.g.,Lf=0.01, CC1_KP=0.1)
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.ComposableInverter.DroopOuter โ Function
DroopOuterPower droop outer control loop implementing P-f and Q-V droop for grid-forming inverters.
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.ComposableInverter.CurrentSource โ Function
CurrentSource(; name, iset_input=false, defaults...)Grid-following current source inverter with triple-loop cascaded control and PLL.
Implements three-loop control: outer current controller (CC2) โ voltage controller (VC) โ inner current controller (CC1). Uses PLL for grid synchronization. Suitable for:
- Grid-following inverters injecting controlled current
- Renewable energy sources (solar, wind) in grid-connected mode
- Active/reactive power control applications
Parameters
iset_input: If true, current setpoint comes from RealInput ports. If false, uses internal isetd/isetq parameters.Lf: Inverter-side filter reactance [pu]. Related to physical inductance by Lf = ฯ0 * Lf_actual.C: Filter susceptance [pu]. Related to physical capacitance by C = ฯ0 * C_actual.Lg: Grid-side filter reactance [pu]. Related to physical inductance by Lg = ฯ0 * Lg_actual.ฯ0: Frame angular frequency [rad/s]. Default: 2ฯ*50 rad/s.- PLL and controller gains (PLLKp, PLLKi, CC1*, VC, CC2_)
defaults...: Additional parameter/variable defaults (e.g.,Lf=0.01, PLL_Kp=100)
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.ComposableInverter.SimplePLL โ Function
SimplePLL(; name, Kp, Ki, defaults...)Basic PLL that tracks the grid voltage angle by driving the q-axis voltage to zero. Uses a PI controller on the angle error signal u_q.
Parameters
Kp: Proportional gainKi: Integral gaindefaults...: Additional parameter/variable defaults
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.ComposableInverter.PLL_LPF โ Function
PLL_LPF(; name, Kp, Ki, ฯ_lpf, defaults...)PLL with an additional low-pass filter on the frequency output. Uses a PI controller on the angle error, followed by a first-order LPF on the estimated frequency ฯ.
Parameters
Kp: Proportional gainKi: Integral gainฯ_lpf: Low-pass filter time constant [s]defaults...: Additional parameter/variable defaults
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.ComposableInverter.VC โ Function
VCVoltage controller for the filter capacitor voltage, implementing PI control with optional current feedforward decoupling.
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.ComposableInverter.CC1 โ Function
CC1Inner current controller for the inverter-side inductor current, implementing PI control with optional decoupling feedforward.
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.ComposableInverter.CC2 โ Function
CC2Outer current controller for the grid-side inductor current, implementing PI control with optional voltage feedforward decoupling.
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.ComposableInverter.LCLFilter โ Constant
LCLFilterLCL output filter (inverter-side inductor, capacitor, grid-side inductor) for inverters, modeled in the global dq-frame.
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.ComposableInverter.LCFilter โ Constant
LCFilterInductor-capacitor (LC) output filter for inverters, modeled in the global dq-frame.
For a concrete list of variables and parameters please check the model source on GitHub.
PowerDynamics.Library.ComposableInverter.LFilter โ Constant
LFilterSingle-inductor (L) output filter for inverters, modeled in the global dq-frame.
For a concrete list of variables and parameters please check the model source on GitHub.
Fault Models
Ground Fault Models
PowerDynamics.Library.RXGroundFault โ Constant
RXGroundFaultShunt RX impedance to ground representing a fault, switchable via the enable parameter.
For a concrete list of variables and parameters please check the model source on GitHub.