← All courses KANSAS STATE UNIVERSITY / ECE 685

L35 / Power-flow analysis

Power Flow IV

Trace PQ and PV updates, distinguish intermediate estimates from completed-sweep mismatch, and test generator Q limits.

Available33 slides
Gauss–Seidel: one sweep at a time

01 / UNDERSTAND & PREDICT

Understand the model, then predict the result

Finalized lecture slides

Open / download original PDF ↗

Follow the original explanations, diagrams, derivations, and examples in slide order, then use the companion experiment below.

L35 original slide 1 of 33
L35 · 1 / 33
Slide text
Loading slide text.

Figures and page order follow the student PDF for this lecture.

L34 specified the operating point. How can successive complex voltage updates reach that point? Follow the source order, compare the temporary PV phasor with its stored value, and decide when the run has actually converged.
  • Derive the PQ update from the conjugated power equation.
  • Use each newly stored neighbor immediately; preserve the slack phasor.
  • Separate PV reactive estimation, temporary angle and magnitude projection.
  • Apply the completed-sweep power test and explain PV-to-PQ switching.
Gauss–Seidel: one sweep at a time: baseline circuit or quantitative model illustration
Model illustration at baseline inputs. Change the parameters in the next section to explore the live diagram.

Isolate voltage without losing the conjugate

V_i^{(r+1)}=\frac{1}{Y_{ii}}\left[\frac{P_i^{\rm spec}-jQ_i^{\rm spec}}{(V_i^{(r)})^*}-\sum_{k\ne i}Y_{ik}\widehat V_k\right]

Conjugating S=VI* gives (P−jQ)/V*. Separate YiiVi, then divide by Yii. The old voltage remains in the denominator, so this is an iterative update rather than a direct linear solve. P and Q are net injections on the common 100 MVA base.

A sweep uses the newest stored neighbors

\widehat V_k=\begin{cases}V_k^{(r+1)},&\text{already visited}\\V_k^{(r)},&\text{not yet visited}\\V_k^{\rm spec},&\text{slack}\end{cases}

The source visits PQ bus 3 before PV bus 2, with no relaxation. Bus 3 uses the old V2; bus 2 immediately uses the new V3. Reusing only old neighbors would define a different iteration. Bus 1 remains 1.03∠0° at every visit.

Estimate reactive power at the PV visit

Q_i^{\rm est}=\operatorname{Im}\!\left\{V_i^{(r)}\left(Y_{ii}V_i^{(r)}+\sum_{k\ne i}Y_{ik}\widehat V_k\right)^*\right\}

Calculate Qest using the old voltage at this bus and its newest neighbors, including YiiVi. This is a mixed-time intermediate estimate. With local reactive load, check generator capability using QG,est=Qnet,est+QL; this source example has no local load at bus 2.

Store the PV angle at the specified magnitude

V_i^{(r+1)}=|V_i|_{\rm spec}\frac{\widetilde V_i}{|\widetilde V_i|},\qquad\arg V_i^{(r+1)}=\arg\widetilde V_i

Within Q limits, insert estimated net Q in the complex update. The temporary voltage generally has the wrong magnitude. Normalize it to |Vi|spec before storing it; the new angle is retained. Neither its real part nor its imaginary part is independently fixed.

Test powers from one completed vector

\Delta^{(r)}=(\Delta P_2,\Delta P_3,\Delta Q_3)^T,\qquad\|\Delta^{(r)}\|_\infty\le\varepsilon

Recompute every bus power after all visits. While bus 2 is PV, test ΔP2, ΔP3 and ΔQ3, not slack P/Q or PV Q. A small voltage change alone is not the course stopping test. The run accepts only when the infinity norm is within epsilon and the active voltage/capability constraints hold; otherwise report the iteration cap.

A reactive limit releases voltage magnitude

Q_i^{\rm spec}=Q_{G,i}^{\rm lim}-Q_{L,i},\qquad(P_i,|V_i|)\longrightarrow(P_i,Q_i)

If estimated generator Q violates a bound, use Qnet,spec=QG,lim−QL and treat the bus as PQ. Stop restoring its former voltage magnitude and add its Q mismatch to the active test. This teaching implementation latches the first violated bound for the rest of that run; each input change restarts the run. It does not implement PV restoration or a general capability curve.

Compare the first sweep with the accepted state

\|\Delta^{(10)}\|_\infty\approx1.50701\times10^{-8},\quad\|\Delta^{(11)}\|_\infty\approx3.65317\times10^{-9}

The flat start is [1.03,1.01,1]. Initially the maximum mismatch is 0.834920635 pu. The first complete sweep gives 0.080047480 pu, so it is not solved. With source Q bounds [−25,50] Mvar, sweep 11 is the first state below 1e−8 pu and reproduces L34. Q2 remains negative but within capability.

Baseline example: check each step

  1. First PQ update: V3=0.968521739−j0.065739130 pu. Store this complex voltage immediately.
  2. At the PV visit, Q2,est=−0.177129371 pu=−17.7129371 Mvar lies within [−25,50].
  3. Temporary V2=1.011364010+j0.004398320; after projection V2=1.009990449+j0.004392346 pu, with magnitude exactly 1.01.
  4. After the complete sweep, mismatches are [+0.008681607,+0.019085452,−0.080047480] pu. End-of-sweep Q2=−20.5197242 Mvar differs from the visit estimate.
  5. Sweep 10 still exceeds epsilon; sweep 11 passes. Final V3≈0.964414∠−3.652309°, P1≈37.88548 MW, Q1≈54.88715 Mvar and Q2≈−16.16487 Mvar.
  6. Set Qmin=0 Mvar: the first negative reactive estimate triggers PQ-min. Its Q becomes specified at zero and |V2| is allowed to depart from 1.01. Do not keep both constraints.
Original slide headings for this lecture33
  1. 1Power Flow IV
  2. 2Lecture outline
  3. 3PART 1: The iteration framework
  4. 4Review: Variables and equations
  5. 5Nonlinear bus power equations
  6. 6The general iteration loop
  7. 7Choose initial voltages
  8. 8Calculate the power mismatch
  9. 9Test convergence and continue
  10. 10PART 2: Gauss–Seidel bus updates
  11. 11Review: Bus specifications and unknowns
  12. 12PQ bus: Power equation to current
  13. 13PQ bus: Isolate the voltage
  14. 14PQ bus: Gauss–Seidel update
  15. 15PV bus: Fixed magnitude, unknown angle
  16. 16PV bus: Calculate the new angle
  17. 17PV bus: Keep magnitude, update angle
  18. 18PV to PQ at a reactive power limit
  19. 19Slack bus: Keep the voltage fixed
  20. 20PART 3: Worked example
  21. 21Example: Generators, load, and bus types
  22. 22Example: Specified injections and unknowns
  23. 23Example: Symbolic PQ update
  24. 24Example: Symbolic PV update
  25. 25Example: Initial state and mismatch
  26. 26Example: PQ voltage update
  27. 27Example: PV reactive estimate
  28. 28Example: PV angle and stored voltage
  29. 29Example: Mismatch after one sweep
  30. 30Example: Repeated sweeps
  31. 31Example: Calculate the slack output
  32. 32Example: Solved voltages and outputs
  33. 33Summary
Cross-check the original slides

02 / EXPLORE

Change one input and explain the response

Compare sweeps 0, 1, 10 and 11. Explain the visit-time and end-of-sweep Q difference. Reverse the bus order, then set Qmin=0 and inspect the changed bus role, voltage magnitude and active mismatch vector. Finally set the cap to one sweep and explain why the run is not accepted.

Advanced parameters / test readings

Preparing the model.

Displayed completed sweep—
Displayed state max mismatch—
Displayed |V3|—
Displayed |V2|—
Q2 estimate at visit—
Q2 after complete sweep—
Run completed sweeps—
Run final max mismatch—

Power mismatch after each completed sweep

Voltage magnitudes and the active PV target

Current intermediate values and numerical checks

Balanced three-bus steady state on 100 MVA; fixed impedances, no shunts/charging, unity taps and no local load at generator buses. Sequential unrelaxed GS; no guarantee of convergence from every start. A Q violation latches that bound as PQ for the remainder of this run; no PV restoration or general capability curve. The displayed sweep is clamped to the completed history when the run stops. Intermediate/capped states remain visible and are labeled unaccepted; failed or invalid updates show an error. Thermal and contingency limits are outside this model. With this latched-limit policy, changing the visit order or starting vector can trigger a different transient bound and lead to a different constrained endpoint.

03 / EDIT & COMPUTE

Edit code to reproduce the model independently

Reproduce the baseline, then modify the parameter scan. The source contains reusable independent model functions; edit the current function and inspect numerical checks.

case is a snapshot of the controls when you press Run. Call solve(case) and assign the final solution to result to plot it.

Download teaching models

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.
Inspect and edit the model source (advanced)

Edit this module's function and run again. case.module selects the module; solve(case) returns values, plots, and checks. The parameter experiment keeps the original JavaScript reference for comparison.

04 / CHECK & EXPLAIN

Companion experiment practice and feedback

Fixed practice inputs

100 MVA; z12=0.018+j0.060, z13=0.070+j0.210, z23=0.045+j0.135 pu; no charging/shunts, unity taps. Slack V1=1.03∠0°, PV P2=55 MW and |V2|=1.01, PQ load=90 MW+j30 Mvar. Start [1.03,1.01,1], visit 3 then 2, no relaxation. QG2 bounds [−25,50] Mvar, epsilon=1e−8, cap=100. Practice asks for the first complete sweep and the full run.

Practice uses fixed baseline inputs independently of the controls. Each field displays its tolerance.

±1e-07 pu
±0.0001 Mvar
±0.0001 Mvar
±0.01 round

Qmin=0 forces generator 2 to its lower bound. What must the next updates do?

Finally, explain in your own words

  1. What are the inputs, references, and main assumptions?
  2. Compare sweeps 0, 1, 10 and 11. Explain the visit-time and end-of-sweep Q difference. Reverse the bus order, then set Qmin=0 and inspect the changed bus role, voltage magnitude and active mismatch vector. Finally set the cap to one sweep and explain why the run is not accepted.
  3. Did your code edit change physical parameters, the method, or representation bases? Which check helps identify that?

Passing numerical and understanding checks records this lecture’s companion practice as “practice checks passed.”

ECE 685 · L35

Course learning assistant

Ask about course material, request an explanation, or follow up.

Choose a context, then ask “What does this mean?”