IBR Dynamic Modeling and Simulation
Equilibrium, Disturbances, and Fair Comparison
C1-09 · Lesson + simulation + practice · Allow 90 minutes
Initialize each model consistently and interpret shared disturbance experiments.
Learning objectives
- Solve a matched point-of-connection operating point.
- Preserve failed or unstable cases in the comparison.
From structure to model
Choose targets at the same physical port
A fair comparison starts from common PoC P, Q, voltage, frequency, system base and grid conditions. Controller commands may differ to realize that target. In the lab, total P = 0.6 pu and Q = 0 for GFL, droop, VSM and parallel cases. The parallel case divides the terminal target into two equal branch contributions.
Use S_b = 10 kVA, V_b = 400 V and f_b = 50 Hz. Grid magnitude is initially 1 pu, X/R = 10 and |Z_g| = 1/SCR. These assumptions define the teaching short-circuit ratio on a common system base. Parallel branch ratings are not used to silently change the grid impedance.
Solve equilibrium before applying a disturbance
At the terminal, S = VI* and V = 1 + Z_g I. Eliminating I gives V = 1 + Z_g conj(S/V). Select the high-voltage root, initialize each controller in its own coordinates, and verify max|f(x₀,u₀)|. Droop and VSM Q* offsets compensate the source-impedance voltage drop; forcing identical raw Q* would produce different terminal operating points.
Keep the event protocol reproducible
Integrate 0–1 s with the old input, then 1–4 s with the new input. The solver places events exactly on integration boundaries; adjacent samples at 1 s show the before and after values. This prevents the Runge–Kutta stages from averaging across a discontinuity. Switch experiments additionally end a segment at 2 s and apply an explicit reset.
The default time step is 0.5 ms. Re-run with half that value in the Python experiment and compare trajectories, rather than treating a smooth plot as evidence of adequate numerical accuracy.
Separate three kinds of evidence
| Evidence | Check here | What it establishes |
|---|---|---|
| Equation consistency | Equilibrium, KCL, power sums and reset residuals | The stated equations and interface agree |
| Model validity | Compare against an explicit higher-order realization over a declared range | A bounded approximation error for that study |
| External validation | Independent measurements or a qualified reference model | Agreement with that external evidence |
The website experiments establish the first row. The source six-family comparison notebook retains stable and unstable rows explicitly and documents its common operating-point protocol. Do not omit an unstable model merely to produce attractive overlays, or infer a global controller ranking from one step test.
Course project
Submit a model contract, your parameter snapshot and Python experiment, a matched-equilibrium table, two disturbance comparisons, and a short explanation of observed differences. Include numerical refinement, retained outputs and validity limits. An extended project can repeat the protocol using the source full-order notebooks and report how the teaching-model conclusions change.
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
S=VI^*,\qquad V=1+Z_g\overline{S/V},\qquad\lVert f(x_0,u_0)\rVert_\infty<\varepsilonZ_g=\frac{1+j\,10}{\mathrm{SCR}\sqrt{101}},\qquad\Delta P^*_{branch}=\frac{\Delta P^*_{total}}{N}e_h=\max_k|P_h(t_k)-P_{h/2}(t_k)|Simulation experiment
- Compare all four models at SCR = 5 with the +0.03 pu total P step.
- Repeat with a +0.1 Hz frequency step; explain the GFL versus GFM steady responses.
- In Python, halve case["dt"] and compare aligned samples; retain the maximum error in the report.
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
Write a comparison protocol before inspecting the trajectories.
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/Single-IBR-Infinite-Bus/12_Single_IBR_Control_Family_Comparison.ipynbResearch-Xirui-Zhang/Coding/xirui_low_frequency/model.py