IBR Dynamic Modeling and Simulation
Reference Frames and Per-Unit Conventions
C1-02 · Lesson + simulation + practice · Allow 60 minutes
Connect three-phase signals to consistent dq equations and units.
Learning objectives
- Apply a declared dq transform and power convention.
- Check angle, frequency, and time units.
From structure to model
Rotate coordinates without changing physical power
For a balanced three-phase signal with no zero sequence, the power-invariant Park matrix maps abc into two rotating axes. Its rows use cos(θ + φₖ) and −sin(θ + φₖ), with φₖ = [0, −2π/3, 2π/3]. The √(2/3) scaling preserves the three-phase inner product. Do not combine this transform with the 3/2 power coefficient from an amplitude-invariant convention.
The inverse on the balanced subspace is the transpose of the Park matrix. A zero-sequence component requires an additional axis; the two-axis inverse cannot recover it.
Power and current references
With current positive toward the network, P = v_d i_d + v_q i_q and Q = v_q i_d − v_d i_q. When the local d axis aligns with voltage, v_q = 0: positive Q requires negative i_q. The current-reference matrix below is the exact inverse of this P–Q map for nonzero voltage.
Per unit still has units behind it
For S_b = 10 kVA, V_b = 400 V line-to-line RMS and f_b = 50 Hz, Z_b = 16 Ω and ω_b = 314.159 rad/s. The power-invariant dq voltage base is 400 V and dq current base is 25 A. The physical line RMS current base is 14.434 A; it is a different quantity.
Define r = R/Z_b, ℓ = L/Z_b in seconds, and c = C Z_b in seconds. Thus inductive reactance at nominal frequency is x = ω_b ℓ. A per-unit inductance written as reactance x cannot be substituted for ℓ in a time-domain derivative.
A numerical check
The experiment uses voltage magnitude 1, current magnitude 0.6 and a 30° current lag. At zero frame offset, v_d = 1, v_q = 0, P = 0.6 cos(30°) = 0.519615 and Q = 0.3. At +20° offset, v_d = cos(20°), v_q = −sin(20°). P and Q stay unchanged because voltage and current rotate together.
An angle relative to the grid obeys δ̇ = ω_b(ω_pu − ω_g,pu). A difference of 0.001 pu at 50 Hz gives 0.314159 rad/s, not 0.001 rad/s.
Core equations
T(\theta)=\sqrt{\frac{2}{3}}\begin{bmatrix}\cos\theta&\cos(\theta-2\pi/3)&\cos(\theta+2\pi/3)\\-\sin\theta&-\sin(\theta-2\pi/3)&-\sin(\theta+2\pi/3)\end{bmatrix}P=v_d i_d+v_q i_q,\qquad Q=v_q i_d-v_d i_q\begin{bmatrix}i_d^*\\i_q^*\end{bmatrix}=\frac{1}{v_d^2+v_q^2}\begin{bmatrix}v_d&v_q\\v_q&-v_d\end{bmatrix}\begin{bmatrix}P^*\\Q^*\end{bmatrix}Z_b=\frac{V_b^2}{S_b},\quad I_{b,dq}=\frac{S_b}{V_b},\quad \dot\delta=\omega_b(\omega_{pu}-\omega_{g,pu})Simulation experiment
- Set the frame offset to 0°, +20° and −90°; compare v_d and v_q.
- Select the P–Q plot and verify that the physical power is invariant.
- Edit the current lag in frame_run() and predict the signs of P and Q before running.
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
Balanced, power-invariant transform without zero sequence. P and Q use the common base.
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
Locate the base-frequency factor in an angle-speed equation.
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/conventions.pyCoding/Modeling/src/ibrsim/schema.py