Dynamic Devices
A dynamic device is a power system component whose behavior is described by differential equations that evolve over time, rather than by a single steady-state operating point. Dynamic devices capture the transient response of equipment — such as how a generator's rotor speed, voltage, or current changes in the milliseconds to seconds following a disturbance. In PowerSystems.jl, every dynamic device is attached to a corresponding static component that provides the power flow solution, while the dynamic component adds the differential equations needed for transient stability and electromagnetic simulation.
Static and Dynamic Data Layers
PowerSystems.jl uses two categories to define data for dynamic simulations:
- Static components, which includes the data needed to run a power flow problem
- Dynamic components are those that define differential equations to run a transient simulation. These dynamic data are attached to the static components.
This division mirrors how dynamic simulation data is commonly distributed: a power flow case (e.g., a PSS/e .raw file) paired with a file of dynamic component data (e.g., a .dyr file). PowerSystems.jl is not constrained to PSS/e files, however — it can take any power flow case and attach dynamic components to it.
Layer 1: Static Components
The first data layer contains all the information necessary to run a power flow problem or dynamic simulations:
- Vector of
Buselements, that define all the buses in the network. - Vector of
Branchelements, that define all the branches elements (that connect two buses) in the network. - Vector of
StaticInjectionelements, that define all the devices connected to buses that can inject (or withdraw) power. These static devices, typically generators, inPowerSimulationsDynamicsare used to solve the power flow problem that determines the active and reactive power provided for each device. - Vector of
PowerLoadelements, that define all the loads connected to buses that can withdraw current. These are also used to solve power flow. - Vector of
Sourceelements, that define source components behind a reactance that can inject or withdraw current. - The base of power used to define per unit values, in MVA as a
Float64value. See Per-unit Conventions. - The base frequency used in the system, in Hz as a
Float64value.
For a hands-on example of building a system with static components, see the Creating a System tutorial.
Once the static layer establishes the network topology and the power flow equilibrium, the dynamic layer can be overlaid on top of it — adding the differential equations that describe how each device behaves when that equilibrium is disturbed.
Layer 2: Dynamic Components
The second data layer contains the additional information describing the dynamic response of certain components in the System. This data is all attached to components defined in the static data layer:
- (Optional) Selecting which of the
Lines(of theBranchvector) elements must be modeled ofDynamicLineselements, that can be used to model lines with differential equations. - Vector of
DynamicInjectionelements. These components must be attached to aStaticInjectionthat connects the power flow solution to the dynamic formulation of such device.
DynamicInjection can be DynamicGenerator or DynamicInverter, and its specific formulation (i.e. differential equations) will depend on the specific components that define each device (see the sections below). As a result, it is possible to flexibly define dynamic data models and methods according to the analysis requirements. DynamicInjection components use a parametric type pattern to materialize the full specification of the dynamic injection model with parameters. This design enables the use of parametric methods to specify the mathematical model of the dynamic components separately.
DynamicInjection components also implement some additional information useful for the modeling, like the usual states assumed by the model and the number of states. These values are derived from the documentation associated with the model, for instance PSS/e models provide parameters, states and variables. Although PowerSystems.jl doesn't assume a specific mathematical model for the components, the default values for these parameters are derived directly from the data model source.
The two concrete forms of DynamicInjection — DynamicGenerator and DynamicInverter — reflect the two fundamentally different physical mechanisms by which machines couple to the grid: rotating synchronous machines and power-electronics-based converters. Each has its own set of sub-components corresponding to the physical and control processes that govern its dynamic behavior.
Dynamic Generator Structure
Each generator is a data structure that is defined by the following components:
- Machine: That defines the stator electro-magnetic dynamics.
- Shaft: That describes the rotor electro-mechanical dynamics.
- Automatic Voltage Regulator: Electromotive dynamics to model an AVR controller.
- Power System Stabilizer: Control dynamics to define an stabilization signal for the AVR.
- Prime Mover and Turbine Governor: Thermo-mechanical dynamics and associated controllers.
Where a synchronous generator's dynamics are rooted in the physics of a rotating mass and magnetic flux, an inverter-based resource has no rotating components — its dynamic behavior is instead shaped entirely by its control algorithms and power electronics. This calls for a different set of sub-components.
Dynamic Inverter Structure
Each inverter is a data structure that is defined by the following components:
- DC Source: Defines the dynamics of the DC side of the converter.
- Frequency Estimator: That describes how the frequency of the grid can be estimated using the grid voltages. Typically a phase-locked loop (PLL).
- Outer Loop Control: That describes the active and reactive power control dynamics.
- Inner Loop Control: That can describe virtual impedance, voltage control, and current control dynamics.
- Converter: That describes the dynamics of the pulse width modulation (PWM) or space vector modulation (SVM).
- Filter: Used to connect the converter output to the grid.⠀
For a hands-on example of constructing and attaching dynamic generator and inverter components to a system, see the Adding Dynamic Data tutorial.