This site is version 0.0.1. Most of the code on this site is drafted by an agent and needs review. I apologize for the AI-speak, we are working on rewriting it!
viv-lang.org
Viv Python

Notebooks · lib/power/cpf

The continuation power flow, a PV curve up to the nose and past it

Push more and more power along one direction (a project's output at the POI, taken out at a sink) and the power flow's solution moves: the voltages sag, and at some transfer the solution stops existing. Near that point, the nose of the PV curve, Newton's method on the plain power flow fails, because its Jacobian becomes singular there: the curve turns back and two solutions (the normal one and a low-voltage one) merge.

The continuation power flow (V. Ajjarapu and C. Christy, "The continuation power flow: a tool for steady state voltage stability analysis", IEEE Trans. Power Systems 7 (1992) 416-423; the pseudo-arclength form of MATPOWER's runcpf) traces the curve through the nose by making the transfer lambda an unknown and adding one equation:

F(x, lambda) = S(V) - S0 - lambda d = 0       (the power flow, x = Va, Vm)
z' ([x; lambda] - [x_k; lambda_k]) = sigma    (the step along the curve)

where z is the unit tangent at the last point, found from [J, -d; z_prev'] z = [0; 1]. Each step predicts x_k + sigma z and corrects by Newton on the augmented system, whose matrix stays nonsingular at the nose. The step grows after an easy correction and halves after a failed one. When a step lands past the nose (lambda falls after rising), the trace returns to the point before the last one and approaches again with a quarter of the step, until the step is below nose_tol; the nose is then known to within about the square of that step. The trace stops once lambda has fallen back below stop_frac of its largest value, or after max_steps.

Here d is +1 per unit at the POI, made up by the reference bus (sink 1) or by the generators in proportion to their output (sink 2), so lambda is the project's output in per unit of baseMVA. Generator reactive limits are not enforced along the curve.

Look inside this program

  • Atlas

    The program’s map: every function and which calls which.

  • There’s no recorded run of this program yet.

This program declares a record type (Cpf), and records run only in compiled C for now, so the Run buttons here are off. Open it in the workbench and use its C tab to compile it.

Shift+Enter in a cell runs it and moves to the next. Running a cell runs every cell above it too, as one program.

[1]lines 38–336