Skip to content

Chapter 3 — Building and solving the network each step

Chapter 2 turned every element into a conductance plus a known history source. This chapter assembles those pieces into the per-step network equation and solves it. We will stamp a real circuit (the underdamped R-L-C step), look at the time-stepping loop the engine runs, and see what happens when a switch changes the topology. This completes the foundational machinery: after this chapter you understand, end to end, how one EMT time step is computed.

Learning objectives

  • Assemble the nodal system GV=I by stamping companion conductances and history sources.
  • Explain the role of the reference (ground) node and of ideal voltage sources.
  • Describe the time-stepping loop and why the system matrix is factorized once and reused.
  • Explain what a switch operation costs the solver.
  • Predict and observe the response of a second-order R-L-C circuit.

3.1 The network at a single step

Freeze the simulation at one time step t. Every reactive element has already been replaced by its companion model (Chapter 2), so the entire network now consists of just two things:

  • conductances Geq (resistors, plus GL=Δt/2L and GC=2C/Δt), and
  • known current sources (the history terms Ihist, plus any independent current sources).

This is a purely resistive circuit, and a resistive circuit is described by one linear system. The unknowns are the node voltages.

3.2 Nodal analysis and stamping (recap)

Pick one node as the reference (ground, 0 V). For every other node, Kirchhoff's current law gives one equation. In matrix form:

GV=I,

where V is the vector of unknown node voltages, I the vector of known current injections, and G the nodal conductance matrix. You never write KCL out by hand; each element stamps its contribution into a few matrix entries. A conductance g between nodes i and j stamps

G[i][i]+=g,G[j][j]+=g,G[i][j]=g,G[j][i]=g,

and a current source Is injected into node i (returning from j) stamps I[i]+=Is, I[j]=Is. Because each element stamps independently, the whole matrix is built in a single pass over the components.

Ideal voltage sources

An ideal voltage source cannot be written as a conductance — it fixes a voltage and passes whatever current is required. NumaSim handles it with modified nodal analysis (MNA): it adds the source's branch current as an extra unknown and a constraint row "ViVj=Vs". The samples in this module all use an ideal DC source, so their source node is pinned to the source voltage. For the worked example below we use that fact directly: the source node sits at V.

3.3 Worked example: stamping the R-L-C step

Take the R-L-C series step sample: an ideal 10 V source feeds a series R, L, C to ground (R=20 Ω, L=0.1 H, C=10 μF, Δt=20 μs). Label the nodes along the loop:

  • VA — source terminal (pinned to 10 V by the ideal source);
  • VB — between R and L;
  • VC — between L and C (this is the capacitor voltage, since C's far end is grounded).
The series R-L-C step circuit. Node VA is pinned to the source; VB lies between R and L; VC is the capacitor voltage. The two unknowns are VB and VC.

The unknowns are VB and VC. Using the companion models from Chapter 2 (inductor current defined BC):

iL=GL(VBVC)+ILhist,iC=GCVC+IChist.

KCL at B (current from R in, inductor current out):

GR(VBVA)+GL(VBVC)+ILhist=0.

KCL at C (inductor current in, capacitor current out):

GL(VBVC)+ILhistGCVCIChist=0.

Collect into matrix form (with VA=10 known):

[GR+GLGLGLGL+GC][VBVC]=[GRVAILhistILhistIChist].

Two observations that generalize:

  • The matrix is symmetric and its off-diagonals are the negative of the shared conductance (GL) — the signature of a passive nodal network.
  • Only the right-hand side changes from step to step (through the history sources). The matrix G is constant as long as the topology and Δt are fixed. That is the key to EMT speed, next.

With Δt=20 μs: GR=1/20=0.05 S, GL=Δt/2L=104 S, GC=2C/Δt=1.0 S. Each step the engine recomputes the two history terms, updates the right-hand side, and solves the 2×2 system.

3.4 The time-stepping loop

Putting Chapters 2 and 3 together, every step is the same three-stage cycle:

Because G is constant between topology changes, it is factorized once; each step then updates the history sources, solves, and recovers currents.

Because G is constant between topology changes, the expensive LU factorization is done once; each step then needs only the cheap forward/backward substitution against the updated right-hand side. A network of thousands of nodes is sparse (each node touches a handful of others), so production engines use sparse factorization and reordering to keep this fast. This "factor once, substitute many" structure is why EMT — despite microsecond steps — runs in reasonable time.

3.5 The reference node

At least one node must be the reference, tied to 0 V by a ground. Without it the conductance matrix is singular (every node voltage could float up together) and the solve fails. In NumaSim every electrical island needs a ground; the samples place one explicitly at the source's return. If you ever build a circuit that refuses to run, a missing ground is the first thing to check.

3.6 Switches and topology changes

A switch, breaker, diode, or transistor changes the network's conductance pattern when it opens or closes — so G itself changes and the "factor once" shortcut is interrupted. EMT engines handle this by re-forming and re-factorizing G when a switch changes state, and by iterating within the step when a device's state depends on the solution (a diode, for instance, conducts only if it is forward-biased, but you don't know the bias until you solve). The solver re-solves until the switch states are consistent with the voltages and currents at the end of the step. This is the gateway to power electronics, the subject of Module 2; for now, just note that switching is what makes the matrix non-constant and costs extra solves.

3.7 Lab: a second-order response

Open the underdamped R-L-C step:

Open the R-L-C series step in app →

Run it and study V_cap. Unlike the first-order R-L and R-C circuits, this one overshoots and rings before settling at 10 V. The series R-L-C has natural frequency and damping ratio

ω0=1LC,ζ=R2CL.

Plug in the sample values:

ω0=1(0.1)(105)=1000 rad/sf0=ω02π159 Hz,ζ=2021050.1=100.01=0.1.

With ζ=0.1 the circuit is lightly damped. The step overshoot of a second-order system is

Mp=eζπ/1ζ2=e0.3160.73,

so the first peak should reach about 10(1+0.73)=17.3 V. Read the peak off the scope: the simulator reports about 17.3 V — matching the closed-form result. The ringing frequency you measure between successive peaks should be close to f0159 Hz (a period of ~6.3 ms).

Now experiment:

  1. Change the damping. Set R=200 Ω. Recompute ζ — you should get 1.0 (critically damped): the overshoot disappears. Try R=400 Ω (overdamped) and R=5 Ω (very lightly damped, many rings).
  2. Change the time step. Increase Δt toward the ringing period and watch the waveform coarsen. The trapezoidal rule stays stable (it never blows up), but the ring amplitude and frequency lose accuracy once you have only a handful of steps per cycle — concrete evidence for the "step an order of magnitude below the fastest period" rule of thumb.

3.8 Summary

  • At each step the network is conductances + known current sources; the node voltages solve GV=I.
  • Elements stamp their contributions independently; companion models stamp Geq into G and Ihist into I.
  • The matrix is symmetric for passive networks and constant between topology changes, so it is factorized once and reused — the source of EMT's efficiency.
  • A reference (ground) node is mandatory; switches change the topology and force re-factorization / in-step iteration.
  • A series R-L-C shows the classic second-order overshoot-and-ring, with ω0=1/LC and ζ=(R/2)C/L predicting the waveform the simulator produces.

3.9 Problems

Problem 3.1. A node k connects to ground through a G=0.25 S conductance, to node m through 0.1 S, and receives a 3 A injection. Write the row of GV=I for node k (in terms of Vk, Vm).

Solution 3.1

The diagonal is the sum of conductances incident on k: 0.25+0.1=0.35. The off-diagonal to m is 0.1. The injection is the right-hand side:

0.35Vk0.1Vm=3.

(The conductance to ground contributes only to the diagonal, since ground is the reference and has no column.)

Problem 3.2. For the R-L-C sample compute GR, GL, and GC at Δt=20 μs, and write the numeric 2×2 conductance matrix.

Solution 3.2

GR=1/20=0.05 S, GL=Δt/2L=20×106/0.2=104 S, GC=2C/Δt=2×105/2×105=1.0 S.

G=[GR+GLGLGLGL+GC]=[0.05010.00010.00011.0001].

Problem 3.3. Why does NumaSim factorize the conductance matrix only once for a switchless linear circuit, and what event forces a re-factorization?

Solution 3.3

For a fixed topology and fixed time step, G is constant — only the right-hand side (history sources) changes each step. LU factorization is the expensive part, so doing it once and reusing the factors with cheap forward/backward substitution per step is a large saving. A change in topology — a switch/breaker/diode/transistor changing state — alters G and forces it to be re-formed and re-factorized.

Problem 3.4. A student builds a single source-resistor-capacitor loop but forgets to place a ground. The simulation fails to solve. Explain why, in terms of the conductance matrix.

Solution 3.4

With no reference node, all node voltages are defined only up to a common additive constant — the matrix G is singular (its rows sum to zero), so GV=I has no unique solution and the factorization fails. Grounding one node fixes it at 0 V, removing that row/column and making the system solvable.

Problem 3.5. For a series R-L-C with L=0.1 H, C=10 μF, what value of R makes the circuit critically damped (ζ=1)? What qualitative change would you see on the scope compared with the 20 Ω sample?

Solution 3.5

ζ=(R/2)C/L=1R=2L/C=20.1/105=2104=2(100)=200 Ω. At 200 Ω the capacitor voltage rises to 10 V as fast as possible without overshooting or ringing — the oscillation seen at 20 Ω disappears.

3.10 References

  • H. W. Dommel, Electromagnetic Transients Program (EMTP) Theory Book, Bonneville Power Administration — network solution and the simulation loop.
  • J. Arrillaga and N. R. Watson, Power Systems Electromagnetic Transients Simulation, IET Power and Energy Series 39 — network solution with switches, subsystems, sparsity, and optimal ordering.

Previous: Chapter 2 — Companion models · Next: Module 2 — Sources, switching, and power electronics.

You have completed Module 1. You now understand how an EMT engine discretizes elements and solves the network each step — the foundation everything else builds on.