← All courses KANSAS STATE UNIVERSITY / ECE 685

L37 / Power-flow analysis

Power Flow VI

Track rebuilt Jacobians, corrections and original residuals through the accepted voltage state.

Available44 slides
Newton power flow: the complete worked iteration

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.

L37 original slide 1 of 44
L37 · 1 / 44
Slide text
Loading slide text.

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

Apply L36 to the complete three-bus example. The source teaching tolerance is 1e−3 pu, so the first accepted state is after two corrections.
  • Reproduce both source corrections and test every residual.
  • Compare accepted states at different tolerances.
Newton power flow: the complete worked iteration: baseline circuit or quantitative model illustration
Model illustration at baseline inputs. Change the parameters in the next section to explore the live diagram.

State and sign

J(x)\Delta x=-f(x)

Use x=[theta2,theta3,v3] with angles in radians. f=[P2−.55,P3+.90,Q3+.30] is calculated minus specified. Slack V1=1.03∠0 and PV magnitude1.01 remain fixed.

First correction

x^{(1)}=x^{(0)}+\Delta x^{(0)}

At x0=[0,0,1], f=[−.620216106,.834920635,.104761905]. The correction is [.006105173,−.060900164,−.032049579]. The new magnitude is .967950421. The original residual norm is still .034828757, above1e−3.

Rebuild at the same state

H_{22}=-Q_2-B_{22}v_2^2

Y-bus stays fixed. Rebuild every Jacobian coefficient at state1, including calculated Q2 for H22. Use the same state for f and J. The second correction is [−.000677730,−.002832790,−.003519776].

Accept at the stated tolerance

\|f(x^{(2)})\|_\infty\le10^{-3}

State2=[.005427443,−.063732955,.964430645] has max residual .0001508627 pu ≤.001. Accept after2 corrections. On100MVA, .001pu is .1MW or Mvar per equation. Do not replace the accepted values with the tighter L34 root.

Recover and check outputs

S_i=V_i(YV)_i^*

At accepted state2, slack P1=37.873990MW,Q1=54.882232Mvar; PV Q2=−16.176200Mvar, within[−25,50]. Actual P2=54.99530MW and P3=−89.98491MW retain small allowed residuals. Fixed bus types here; no outer PV/PQ limit switching is implemented.

Baseline example: check each step

  1. At x0=[0,0,1], f=[−.620216106,.834920635,.104761905]. The correction is [.006105173,−.060900164,−.032049579]. The new magnitude is .967950421. The original residual norm is still .034828757, above1e−3.
  2. Y-bus stays fixed. Rebuild every Jacobian coefficient at state1, including calculated Q2 for H22. Use the same state for f and J. The second correction is [−.000677730,−.002832790,−.003519776].
  3. State2=[.005427443,−.063732955,.964430645] has max residual .0001508627 pu ≤.001. Accept after2 corrections. On100MVA, .001pu is .1MW or Mvar per equation. Do not replace the accepted values with the tighter L34 root.
  4. At accepted state2, slack P1=37.873990MW,Q1=54.882232Mvar; PV Q2=−16.176200Mvar, within[−25,50]. Actual P2=54.99530MW and P3=−89.98491MW retain small allowed residuals. Fixed bus types here; no outer PV/PQ limit switching is implemented.
Original slide headings for this lecture44
  1. 1Power Flow VI
  2. 2Lecture outline
  3. 3PART1: Quickreview
  4. 4Review: Scalar Newton iteration
  5. 5Review: Vector Newton iteration
  6. 6Review: Power flow in zero-residual form
  7. 7Review: Selected unknowns and residuals
  8. 8Review: Power flow Newton update
  9. 9PART2: Thecomplete worked example
  10. 10Example: Generators, load, and network
  11. 11Example: Specified data and unknowns
  12. 12Network calculation: Branch admittances
  13. 13Network calculation: The complete Y-bus
  14. 14Initial guess and residual order
  15. 15The network functions inside the residuals
  16. 16Iteration 0: Calculate P2 and P3
  17. 17Iteration 0: Calculate Q3 and Q2
  18. 18Iteration 0: Evaluate the residual
  19. 19Iteration 0: Label the Jacobian
  20. 20Iteration 0: The P2 derivative row
  21. 21Iteration 0: The P3 derivative row
  22. 22Iteration 0: The Q3 derivative row
  23. 23Iteration 0: Solve for the correction
  24. 24First correction: Update the voltage state
  25. 25Voltage changes after correction 1
  26. 26What the first linear model predicts
  27. 27At state 1: Recalculate P2
  28. 28At state 1: Recalculate P3 and Q3
  29. 29At state 1: Test the original residual
  30. 30Why the first correction leaves a residual
  31. 31Iteration 1: Inputs for the new Jacobian
  32. 32Iteration 1: The P2 derivative row
  33. 33Iteration 1: The P3 derivative row
  34. 34Iteration 1: The Q3 derivative row
  35. 35Iteration 1: Rebuild and solve
  36. 36Correction 2: Add the new state change
  37. 37At state 2: Evaluate the power terms
  38. 38At state 2: Test the original residual
  39. 39Voltage changes after correction 2
  40. 40Convergence of every selected equation
  41. 41PV capability at every tested state
  42. 42Accepted state: Calculate the slack power
  43. 43Example: Accepted voltages and outputs
  44. 44Summary
Cross-check the original slides

02 / EXPLORE

Change one input and explain the response

Inspect states0,1,2; compare their f and rebuilt J. Tighten epsilon to1e−8 or cap the run at1, then explain acceptance and PV capability separately.

Advanced parameters / test readings

Preparing the model.

Displayed completed corrections—
Run completed corrections—
Displayed max residual—
Run final max residual—
Displayed bus 3 magnitude—
Displayed slack P—
Displayed slack Q—
Displayed PV Q—

Original residual and tolerance

PQ voltage magnitude through corrections

Current intermediate values and numerical checks

Fixed three-bus topology and bus types. Full undamped corrections; failed updates report errors, capped runs are unaccepted. Generator Q capability is checked separately, without PV/PQ switching. Requested display beyond completed history shows the last state. At an accepted state, the displayed next correction is diagnostic and is not applied.

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

100MVA; z12=.018+j.060,z13=.070+j.210,z23=.045+j.135 pu. Slack1.03∠0, PV2 P=.55,v2=1.01; PQ3 P=−.90,Q=−.30. No local loads at generators, no shunts, unity taps. Flat start [0,0,1], full undamped Newton steps, tolerance1e−3, cap100.

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

±0.01
±1e-06 pu
±0.0001 MW
±0.0001 Mvar

Why is P2 not exactly55MW at the accepted state?

Finally, explain in your own words

  1. What are the inputs, references, and main assumptions?
  2. Inspect states0,1,2; compare their f and rebuilt J. Tighten epsilon to1e−8 or cap the run at1, then explain acceptance and PV capability separately.
  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 · L37

Course learning assistant

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

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