L37 / Power-flow analysis
Power Flow VI
Track rebuilt Jacobians, corrections and original residuals through the accepted voltage state.
01 / UNDERSTAND & PREDICT
Understand the model, then predict the result
- Reproduce both source corrections and test every residual.
- Compare accepted states at different tolerances.
State and sign
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
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
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
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
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
- 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.
- 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].
- 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.
- 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.
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.
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.
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.
Last Python run and current control reference
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
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.
See the worked solution
- 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.
- 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].
- 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.
- 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.
Finally, explain in your own words
- What are the inputs, references, and main assumptions?
- 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.
- 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.”
