Appearance
Control Loop Delay
A stopwatch for the engine: a square-wave command opens and closes a breaker, and the load current comes back into the control domain, so you can count the exact number of time steps each domain crossing costs.
The circuit is deliberately trivial so that nothing but the timing is interesting. A signal_gen square wave at 10 Hz swings cmd between 0 and 1, which commands a breaker feeding a 10 Ω resistor from a 10 V DC source. The resistor publishes its current as i_load. A From tag picks i_load back up into the control domain, a unity gain passes it through, and a Go-To republishes it as i_ctl. The run uses a 1 ms time step over 0.2 s — far coarser than a real EMT study, chosen so that a one-step delay is a visible millisecond on the scope instead of an invisible microsecond.
Plot cmd, brk, i_load, and i_ctl together and read off the edges. The command falls at t = 0.050 s. The breaker state brk and the load current i_load do not follow until t = 0.051 s, one step later. The control-domain copy i_ctl does not follow until t = 0.052 s, two steps later. The same ladder repeats on every edge — cmd switches at 0.050, 0.100 and 0.150 s, the electrical pair at 0.051, 0.101 and 0.151 s, and i_ctl at 0.052, 0.102 and 0.152 s. It is also there at start-up: cmd is already high in the first recorded row at t = 0.001 s, i_load reaches 0.9998 A at t = 0.002 s, and i_ctl gets there at t = 0.003 s.
Nothing about this is a numerical artifact you should try to tune away. Every signal crossing between the control domain and the electrical network is bound to the previous step's value, in both directions, because the two domains have no execution dependency on each other and can run in either order within a step. One crossing costs one step; a loop that leaves the control domain and comes back costs two. The closed value 0.9998 A is just
Two experiments worth running. Cut the time step to 100 µs and the delays shrink to 0.1 ms each: the lag is always two steps, never a fixed amount of time, which is why it stops mattering once the step is small compared with the dynamics you care about. Then raise the square-wave frequency toward the step rate and watch the loop stop tracking altogether — the point at which a two-step lag becomes a real modeling error rather than a curiosity.