IBR Dynamic Modeling and Simulation
VSM and Virtual Inertia
C1-06 · Lesson + simulation + practice · Allow 90 minutes
Distinguish a virtual rotor from a PLL-based inertia power request.
Learning objectives
- Read a VSM swing equation and its static droop relation.
- Separate requested support from delivered power.
From structure to model
Add a frequency state, rather than a name
A virtual synchronous machine replaces algebraic P–frequency droop with an evolving internal speed. The four-state teaching realization contains δ, ω, P_f and Q_f. Its electrical source and reactive-power law are the same as Module 5. This isolates the effect of the synchronization law.
Use Mω̇ = P* − P_f − D(ω − 1), with M in seconds and D = 1/m_p. If M = 2H under this per-unit swing convention, the default M = 4 s corresponds to H = 2 s. The angle equation still multiplies per-unit frequency difference by ω_b.
Keep steady slope separate from inertia
At steady state, P_f = P* − D(ω_g − 1), the same slope as the droop controller when D = 1/m_p. M affects the transient speed derivative, not this steady slope. The source repository separates governor and explicit damping coefficients, constraining their sum to 1/m_p; our lab uses the aggregate coefficient.
Immediately after a +0.03 pu P* step, at the old equilibrium, ω̇ = 0.03/4 = 0.0075 pu/s. Expressed in Hz/s that is 0.375. Doubling M halves this initial derivative when all other initial conditions and coefficients are held fixed.
What supports the electrical power?
“Virtual inertia” describes a control law. The lab assumes an ideal DC source and unlimited voltage/current realization. It cannot establish DC energy availability or converter overload capability. To study those questions, add DC storage dynamics, device limits and their control interactions.
Do not merge GFL virtual inertia with VSM
A GFL virtual-inertia controller can add a causal filtered RoCoF-dependent power request while retaining PLL-based synchronization. That is a different model structure from an internal VSM speed state. The repository’s GFL-VI notebook includes an unstable frozen-parameter example; adding an inertia-labelled term is not a stability guarantee.
Compare M = 1, 4 and 8 s with the same SCR, droop slope and measurement filters. Report initial RoCoF, peak power and settling behavior. A reduced VSM response cannot certify the stability of the repository’s higher-order electrical and inner-control realizations.
The default 4 s window may end before VSM settles, especially with the retained 0.1 s power filter. Extend the duration to 20 s before discussing a steady value. Some parameter choices can produce growing oscillations; preserve that result and check the model domain.
Core equations
M\dot\omega=P^*-P_f-D(\omega-1),\qquad D=\frac1{m_p},\qquad M=2H\dot\delta=\omega_b(\omega-\omega_g),\qquad P_{\infty}=P^*-\frac{\omega_g-1}{m_p}\dot f(1^+)=f_b\frac{\Delta P^*}{M}Simulation experiment
- With M = 4 s, predict the initial frequency derivative for a +0.03 pu step.
- Repeat at M = 1 and 8 s while holding m_p and SCR fixed.
- Use the frequency-step experiment to compare the steady slope with droop GFM.
Laboratory · Python runs in your browser
Predict → run → inspect
Predict the response, then change a parameter and run. The initial plot is a baseline generated by the same solver. The first computation downloads Python; later runs reuse it.
Loading the baseline…
Numerical audit and samples
Low-frequency teaching realization: nominal-frequency algebraic network and ideal current/voltage realization. 50 Hz, 10 kVA, 400 V; initial PCC total P = 0.6, Q = 0; X/R = 10. τᵢ = 0.02 s, τₚ = 0.1 s, τq = 0.05 s, nq = 0.0325; GFM source impedance 0.00625 + j0.1 pu. LCL, inner PI, DC dynamics and current limits are omitted.
Edit the model and reproduce the experiment
The code reads the controls above and plots its own result. Edit the experiment or expand the solver source to test your prediction. Download experiment produces one .py file containing the parameters, full solver and experiment code; local execution needs only Python 3.
case is a snapshot of the controls when you press Run. Call solve(case) and assign the final solution to result to plot it.
The first run needs internet access to download Python. Computation stays in your browser; the solver uses only the standard library.
Ready to run.
Output appears here.
Python result
Inspect and edit the model source (advanced)
The source contains the transforms, LCL, PLL, droop, VSM, shared PCC and explicit reset. Source edits affect the next Python experiment; the laboratory above retains the original teaching equations.
Check your understanding
Explain why more virtual inertia need not improve stability.
Continue in the source repository
Adapted from local PINN-IBR materials reviewed on 2026-10-03. The web code is a separately authored teaching realization. These repository paths contain the detailed models, configurations and research cases.
Coding/Modeling/src/ibrsim/models/vsm_gfm.pyCoding/Modeling/Single-IBR-Infinite-Bus/06_VSM_GFM_Infinite_Bus.ipynbCoding/Modeling/Single-IBR-Infinite-Bus/04_GFL_PLL_Virtual_Inertia_Infinite_Bus.ipynb