GridPACK’s dynamic simulation module uses a full Y-matrix formulation to integrate the differential-algebraic equations (DAE) governing synchronous machine transient behavior. TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/GridOPTICS/GridPACK/llms.txt
Use this file to discover all available pages before exploring further.
DSFullApp class in the gridpack::dynamic_simulation namespace implements the complete simulation workflow: loading a PSS/E network, reading .dyr generator parameters, initializing state from a converged power flow, and stepping through time with branch-fault events. The module is designed to be extended—generator, exciter, governor, PSS, relay, dynamic load, and inverter-based resource (IBR) models are plugged in via a factory pattern, and users can add new device types without modifying the integration loop.
Supported device models
The full-Y dynamic simulation module supports the following model types. These are read from a PSS/E.dyr file specified in the generatorParameters field of the input deck.
Generator models
| Model | Description |
|---|---|
GENCLS | Classical generator (constant voltage behind reactance) |
GENSAL | Salient-pole synchronous generator |
GENROU | Round-rotor synchronous generator with full flux dynamics |
| Model | Description |
|---|---|
REGCA1 | Renewable energy generator/converter model A type 1 |
REGCB1 | Renewable energy generator/converter model B type 1 |
REGCC1 | Renewable energy generator/converter model C type 1 |
GDFORM | Grid-forming inverter model |
REECA1 | Renewable energy electrical control model A type 1 |
REPCA1 | Renewable energy plant control model A type 1 |
The
EPRIA1 inverter-based resource model is also available when GridPACK is compiled with the ENABLE_EPRI_IBR_MODEL CMake flag.EXDC1, ESST1A, IEEET1, SEXS, ESST4B
Governor models: WSIEG1, WSHYGP, TGOV1, GAST, HYGOV, GGOV1
Power system stabilizer: PSSSIM
Wind turbine models: WTARA1, WTDTA1, WTPTA1, WTTQA1
Relay models: LVSHBL, FRQTPAT, DISTR1
Dynamic load models: ACMTBLU1, IEEL, MOTORW, CIM6BL
Simulation workflow
Initialize power flow
The recommended entry point is This is equivalent to creating a
solvePowerFlowBeforeDynSimu(), which runs a full power flow internally and maps the converged bus voltages onto the dynamic simulation network. The power flow network is destroyed inside its own scope, avoiding Global Arrays handle conflicts.PFAppModule, running solve(), calling saveData(), and then cloning the network into a DSFullNetwork—but with proper lifecycle management.Read generator parameters
Load dynamic model parameters from the PSS/E The optional
.dyr file named in generatorParameters:ds_idx argument selects from a list of .dyr files when the input deck specifies multiple files.Read sequence data (optional)
For applications that require sequence network data (e.g., unsymmetrical fault studies):
Initialize the simulation
Set up internal state variables and the full Y-matrix. When
equilibriumInit is true in the input deck, this step runs an iterative Norton-equivalent initialization that eliminates pre-fault drift by rebalancing generator states (Pmech = Telec, Efd = LadIfd) at the network-solved voltage.Configure generator monitoring
Activate time-series output for watched generators specified in the The watched variables are rotor speed and rotor angle for each monitored generator. Results are written to the file named in
generatorWatch block:generatorWatchFileName at the interval set by generatorWatchFrequency (in time steps).Load fault events
Build the list of fault events from the input deck’s Faults can also be declared in a separate file; point the cursor at any block containing an
Events block:Events child to load from that source.XML input file structure
TheDynamic_simulation block controls all simulation parameters:
Multiple
faultEvent blocks can appear within the Events block. It is also possible to reference an external fault list file, which is convenient for contingency-driven dynamic security assessment workflows with many events.Fault simulation
Faults are defined on branches. EachfaultEvent specifies the begin and end times of the fault, the two bus indices identifying the faulted branch, and an optional time step override for the fault interval. The solver automatically switches between normal and faulted Y-matrix formulations at beginFault and endFault. Negative PG generators (absorbing machines) are supported in GENROU, GENSAL, and classical models.
Time series data access from code
In addition to file-based output, time series data for watched generators can be retrieved programmatically:series alternates between rotor speed and rotor angle for each watched generator on the local MPI rank.
Data collection update
At any point during or after a simulation, the methodupdateData() copies current internal variable values into each network component’s DataCollection object, making them accessible for post-processing or chaining to other modules:
BUS_VMAG_CURRENT, GENERATOR_PG_CURRENT, GENERATOR_QG_CURRENT, BRANCH_FROM_P_CURRENT, BRANCH_FROM_Q_CURRENT, and others.
Running the standalone binary
Thedsf.x binary reads configuration from input.xml by default. Pass a filename as the first argument to override:
readNetwork().
Power flow
Use PFAppModule to generate the converged base case that initializes the dynamic simulation.
Contingency analysis
Screen N-1 contingencies using the power flow module before launching dynamic studies.