BUILD IT TOGETHER · LESSON 01
First predict. Then change one thing.
01 / PHYSICSVoltage drives current through impedance.
Start with Reset. Convert 13.8 kV line-to-line to 7.967 kV phase-to-neutral. For the bolted ABC case, divide that phasor by 0.2 + j2 Ω. The current lags because the impedance is inductive.
02 / EXPERIMENTMake the source weaker.
Predict the result before selecting Weaker source. The preset doubles all sequence impedances. For the bolted fault, the primary current halves. Changing only the CT rating changes the relay quantity, not the primary fault.
03 / EXPLAINCompare ABC with A–G.
For an A–G fault with no pre-fault load, I₀ = I₁ = I₂, and Iₐ = 3I₁. The B and C currents are zero. Their bus voltages need not be zero. Increase Z₀ and explain why the ground-fault current falls.
How the code is organized
power-math.mjs contains the complex-number operations, sequence-network equations and phase reconstruction. power-lab.mjs reads the form, calls the solver and draws the results. Keeping those separate lets us check the engineering without relying on the display.
// Phase-A-to-ground fault; all quantities are primary.
const I1 = E1 / (Z1 + Z2 + Z0 + 3 * Rf);
const Ia = 3 * I1;
const relayCurrent = Ia / (CTprimary / CTsecondary);
This excerpt is mathematical pseudocode. JavaScript needs the explicit complex-number functions in the solver; ordinary division cannot divide complex objects.
Your first coding exercise
Find the solve function. Trace the input voltage to E, then the sequence current to phases, then the CT ratio to secondary. Before changing the solver, reproduce the default current using a separate hand calculation.
Model assumptions, validation and references
This is an educational single-bus, single-source Thevenin model, with balanced positive-sequence pre-fault voltage and ABC rotation. It calculates steady RMS fundamental-frequency phasors. No load, shunt capacitance, motor/IBR contribution, CT saturation, DC offset, transformer vector-group conversion, protection operation or clearing-time simulation is included. The CTs are ideal and located on the only source contribution path.
All sequence impedances are entered at the bus voltage base in primary ohms. Include grounding/neutral contributions in Z₀; do not add them twice. For ABC, Rf is the same per-phase fault resistance. For A–G, it is the A-to-ground fault resistance. Opening the breaker isolates this otherwise unsupplied bus: all bus voltages and currents are zero in this model.
This is not a multi-bus study or a substitute for a reviewed engineering model. Calculation checks cover analytic reference cases, fault-boundary conditions, sequence reconstruction, CT scaling and invalid inputs.