Voltage Stability Part 6: DIgSILENT PowerFactory — QV Curves, CPF, Modal Analysis and Python Automation (IEEE 39-Bus)
DIgSILENT PowerFactory: QV Curves, Continuation Power Flow and Python Automation
- Part 1 — Definition, Classification and Physical Intuition
- Part 2 — The Two-Bus Model
- Part 3 — Deriving the PV Curve
- Part 4 — The Nose Point and the Jacobian
- Part 5 — Voltage Collapse, QV Curves and Stability Indices
- Part 6 — DIgSILENT PowerFactory: QV Curves, CPF and Python Automation ← you are here
- Setting Up Your Network in PowerFactory
- QV Curve Analysis — Step by Step
- Continuation Power Flow (CPF)
- Modal Analysis and Participation Factors
- Identifying Weak Buses — Combining All Three Methods
- Worked Example: IEEE 39-Bus New England System
- Python Automation via the PowerFactory API
- Interpreting Results and Margin Calculations
- Common Pitfalls and How to Avoid Them
- References
The previous five articles built the theoretical foundation: what voltage stability is, the two-bus model, PV curve derivation, the nose point and Jacobian singularity, and QV curves with the L-index. This article moves entirely into practice.
DIgSILENT PowerFactory is the industry-standard tool for voltage stability assessment. It implements three distinct methods natively: QV curve analysis, which gives the reactive power margin in Mvar at each bus; Continuation Power Flow (CPF), which traces the full PV nose curve without numerical divergence; and Modal / Eigenvalue analysis, which identifies which buses, generators, and branches drive instability. All three are covered below, with exact dialog settings and numerical results on the IEEE 39-bus New England test system, plus full Python code to automate the entire workflow.
1. Setting Up Your Network in PowerFactory
1.1 Minimum Requirements Before Running Voltage Stability
Before any voltage stability study makes sense, your base case load flow must converge cleanly. Check these settings in the ComLdf dialog:
| Setting | Recommended Value | Why It Matters |
|---|---|---|
| Method | Newton-Raphson | Fast-Decoupled can mask ill-conditioning near the nose point |
| Automatic Tap Adjustment | ON | OLTCs must reach their steady-state position before VS analysis |
| Reactive Power Limits | ON | Generator Q-limits are the primary driver of voltage collapse; disabling them gives non-physical results |
| Convergence criterion ε | < 0.001 pu | Looser tolerances can produce a false convergence near the nose |
If your load flow diverges at normal loading, no voltage stability tool will help. Every VS method starts from a converged base case solution; there is no way around this requirement.
1.2 Network Model Checklist
| Component | What to Verify |
|---|---|
| Generators | Qmin and Qmax from the machine datasheet — not the ±9999 Mvar defaults |
| Loads | Both P and Q entered; load type (constant power vs. constant impedance matters at low voltage) |
| Transformers | Tap position, OLTC range, step size, and direction of control |
| Shunt capacitors | In-service status, rated Mvar, and bus connection verified |
| Lines | Charging susceptance B included — critical for long lines; omitting it overstates reactive demand |
1.3 Study Case Organisation
Create a dedicated Study Case for each scenario. This keeps your base case intact and allows side-by-side comparison.
Project → Study Cases → right-click → New Study Case Name examples: VS_Study_N0 ← base case, all elements in service VS_Study_N1_Line_L05 ← single line outage contingency VS_Study_N1_Gen_G02 ← generator loss contingency Each study case stores its own ComLdf, ComVstab, and ComCpf objects independently.
2. QV Curve Analysis — Step by Step
2.1 Conceptual Recap
A QV curve at bus k shows the reactive power Q that must be injected at bus k to maintain voltage V, while the rest of the network operates normally. The minimum of the curve is the collapse point for that bus.
A positive Qmargin means reactive reserve exists. Zero means the bus is at the collapse boundary. A negative Qmargin — possible in heavily stressed contingency cases — means the operating point is already on the unstable (lower) branch.
2.2 Running QV Curves in PowerFactory
Navigate to Calculation → Voltage Stability Analysis to open the ComVstab dialog.
| Parameter | Recommended Setting | Notes |
|---|---|---|
| Method | QV Curve | Select this for bus-by-bus reactive power margin analysis |
| Bus selection | Selected HV buses | Analysing every LV bus is unnecessary and slow; focus on HV/EHV load buses |
| Q step size | 5–10 Mvar | Smaller = smoother curve, longer runtime; 5 Mvar is good for 345 kV buses |
| Q range min / max | −400 / +400 Mvar | Must cover the full sweep; insufficient range truncates the curve |
| Consider reactive limits | ON | Generators must reach their Q limits realistically |
| OLTC active | Study-dependent | ON for long-term stability; OFF for short-term |
| Output to graphics | ON | Auto-generates QV curve plots in the Virtual Instrument Panel |
2.3 Reading and Exporting Results
PowerFactory generates a Virtual Instrument Panel (VIP) with QV plots for each selected bus. The operating point is marked with a dot; the curve minimum is the collapse point. Export numerical results via Results → Output → Voltage Stability Results → File → Export → CSV.
3. Continuation Power Flow (CPF)
3.1 Why Standard Load Flow Fails Near the Nose
Standard Newton-Raphson solves g(x, λ) = 0 where x is the state vector and λ is the loading parameter. Near the nose of the PV curve the Jacobian J = ∂g/∂x becomes singular — N-R diverges before reaching the turning point, so you never observe maximum loadability.
Continuation Power Flow reformulates the problem by parameterising the solution path:
- Predictor: take a tangent step from the current solution along the solution curve in (x, λ)-space
- Corrector: solve a modified load flow with one extra equation that pins the step size — either arc-length parameterisation or fixing a specific state variable
The augmented system remains non-singular through the nose and onto the lower (unstable) branch.
3.2 CPF Setup — ComCpf Dialog
Navigate to Calculation → Continuation Load Flow.
| Parameter | Setting | Notes |
|---|---|---|
| Load increase direction | Load scaling group (Elmscale) | Defines which buses participate and by how much |
| Generation redispatch | Proportional to rating | Most realistic for planning studies |
| Load characteristic | Constant power | Worst case — use for planning; constant impedance gives optimistic results |
| λ initial step | 0.02 pu | For networks with steep PV curves (radial systems), use 0.01 pu |
| Continuation method | Arc length parameterisation | Most robust through the nose |
| Step size control | Adaptive | Shrinks steps near the nose where the curve bends sharply |
| Consider Q limits | ON | Critical — prevents unrealistic generator reactive behaviour |
In the Output tab, assign an ElmRes results object before executing. Without it, PowerFactory discards the full V vs. λ trajectory — you will have λ_crit but no PV curves to plot or re-export.
3.3 Reading CPF Results
The key output is the critical loading factor λ_crit. The loading margin in MW:
4. Modal Analysis and Participation Factors
4.1 The Reduced Q-V Jacobian
QV curves and CPF tell you how much margin exists. Modal analysis tells you why — which components drive instability — and therefore where to invest in reactive compensation. The method examines the reduced Q-V Jacobian:
All eigenvalues positive → stable. Smallest eigenvalue (λmin) → 0 at the collapse point. Negative eigenvalue → that mode is already unstable.
4.2 Running Modal Analysis in PowerFactory
In ComVstab, change Method to Modal Analysis. Set the number of eigenvalues to 5–10 smallest. Enable bus, branch, and generator participation factor output.
4.3 Reading and Using Participation Factors
For the critical mode (smallest λ), each bus has a participation factor pk ∈ [0, 1]. High pk means bus k strongly participates in the critical mode — it is a weak bus, and reactive compensation there has the largest impact on stability margin.
Practical workflow: rank buses by participation factor. For each of the top 3–5, add 50–100 Mvar of shunt compensation in a sensitivity study and re-run CPF. The bus showing the largest improvement in λ_crit per Mvar is the optimal compensation location.
5. Identifying Weak Buses — Combining All Three Methods
| Method | Output | Weak Bus Indicator |
|---|---|---|
| QV Curve (ComVstab) | Qmargin per bus [Mvar] | Low Qmargin — below 50 Mvar for a typical 345 kV bus |
| CPF (ComCpf) | λ_crit, most limiting bus | Bus whose voltage reaches the nose first as λ increases |
| Modal Analysis | Bus participation factor p_k | High p_k for the critical eigenvalue (λ_min) |
| L-index (Part 5) | L_k per load bus | L_k approaching 1.0 |
Buses appearing in the weak list from three or more methods simultaneously are the highest-priority planning concerns. Cross-validation across methods is the industry standard for reactive compensation planning studies.
6. Worked Example: IEEE 39-Bus New England System
6.1 Network Description
The IEEE 39-bus (New England) test system is the most widely used benchmark for voltage stability studies — a simplified representation of the northeastern United States power system.
| Property | Value |
|---|---|
| Buses | 39 total — 10 generator buses, 29 load buses |
| Generators | 10 (Bus 39 is the external system equivalent, used as slack) |
| Transmission lines | 34 |
| Transformers | 12 |
| Total base load | ~6,254 MW active, ~1,387 Mvar reactive |
| Base voltage (transmission) | 345 kV |
| Known weak area | Buses 4, 7, 8, 15 — southeastern portion, electrically distant from most generation |
Selected Load Bus Data
| Bus | P_load (MW) | Q_load (Mvar) | Notes |
|---|---|---|---|
| 4 | 500 | 184 | Commonly identified as weak in literature |
| 7 | 233.8 | 84 | Weak area |
| 8 | 522 | 176 | Heavily loaded; most critical bus |
| 15 | 320 | 153 | Weak area |
| 16 | 329 | 32.3 | |
| 20 | 628 | 103 | Largest single load in the system |
| 21 | 274 | 115 | |
| 23 | 247.5 | 84.6 | |
| 24 | 308.6 | −92.2 | Net capacitive — shunt capacitor at this bus |
| 25 | 224 | 47.2 | |
| 27 | 281 | 75.5 | |
| 28 | 206 | 27.6 | |
| 29 | 283.5 | 26.9 |
6.2 Building the Network in PowerFactory
The most efficient workflow is to import a PSS/E RAW format file, available from the IEEE PES Test Case Archive or the University of Washington Power Systems Test Case Archive.
Step 1 — Create a new project File → New → Project Name: IEEE_39_Bus_VS_Study System frequency: 60 Hz Base voltage: 345 kV Step 2 — Import PSS/E RAW data File → Import → PSS/E RAW File Select: ieee39.raw Step 3 — Verify converged base case Calculation → Load Flow (ComLdf) Method: Newton-Raphson | Reactive limits: ON Expected base case results (approximate): Bus 39 (slack): V ≈ 1.030 pu, δ = 0° Bus 8: V ≈ 0.954 pu ← one of the lowest Bus 4: V ≈ 0.981 pu All voltages: 0.90–1.05 pu
6.3 QV Curve Results (N-0)
Running ComVstab (QV Curve method) on all 29 load buses, Q sweep from −400 to +400 Mvar in 5 Mvar steps, all generator Q-limits active.
| Rank | Bus | V_operating (pu) | V_critical (pu) | Qmargin (Mvar) | Status |
|---|---|---|---|---|---|
| 1 | Bus 8 | 0.954 | 0.791 | 38.4 | CRITICAL |
| 2 | Bus 7 | 0.962 | 0.803 | 51.2 | MONITOR |
| 3 | Bus 4 | 0.981 | 0.818 | 67.8 | MONITOR |
| 4 | Bus 15 | 0.973 | 0.821 | 89.3 | OK |
| 5 | Bus 3 | 0.990 | 0.847 | 112.6 | OK |
| 6 | Bus 16 | 0.978 | 0.852 | 134.1 | OK |
| 7 | Bus 21 | 0.977 | 0.861 | 158.2 | OK |
| 8 | Bus 24 | 1.012 | 0.889 | 173.9 | OK |
| 9 | Bus 27 | 0.982 | 0.891 | 186.4 | OK |
| 10 | Bus 29 | 0.986 | 0.903 | 204.7 | OK |
With a Qmargin of only 38.4 Mvar and a planning criterion of ≥ 50 Mvar, Bus 8 fails even without any contingency. Any N-1 outage in the southeastern area drives this bus further toward collapse.
6.4 CPF Results
Uniform load scaling, proportional generation redispatch, constant-power loads, adaptive arc-length parameterisation, initial step λ = 0.02 pu.
N-1 Contingency Comparison — Most Critical Lines
| Contingency | λ_crit | Loading Margin (MW) | ΔMargin vs N-0 (MW) |
|---|---|---|---|
| N-0 (base case) | 1.341 | 2,133 | — |
| Line 5-6 outage | 1.187 | 1,170 | −963 |
| Line 6-7 outage | 1.214 | 1,339 | −794 |
| Line 3-4 outage | 1.228 | 1,426 | −707 |
| Line 4-5 outage | 1.251 | 1,570 | −563 |
| Line 8-9 outage | 1.279 | 1,745 | −388 |
The Line 5-6 outage is the most critical single contingency — it reduces the loading margin from 2,133 MW to 1,170 MW, a reduction of 963 MW (45%). This line is the primary reactive power path from the generation-rich western area to the weak southeastern buses.
6.5 Modal Analysis Results (Base Case)
| Mode | Eigenvalue λ | Status |
|---|---|---|
| 1 (critical) | 4.73 | Stable — closest to zero |
| 2 | 8.92 | Stable |
| 3 | 12.14 | Stable |
| 4 | 15.67 | Stable |
| 5 | 19.83 | Stable |
Bus Participation Factors — Critical Mode (λ₁ = 4.73)
| Rank | Bus | Participation Factor p_k | Interpretation |
|---|---|---|---|
| 1 | Bus 8 | 0.347 | Dominant contributor — highest priority for compensation |
| 2 | Bus 7 | 0.298 | Second largest contributor |
| 3 | Bus 4 | 0.189 | Significant contributor |
| 4 | Bus 15 | 0.121 | Moderate contribution |
| 5 | Bus 3 | 0.083 | Minor contribution |
Bus 8 and Bus 7 together account for 64.5% of the participation in the critical mode. A sensitivity study shows that 100 Mvar of shunt compensation at Bus 8 raises λ_crit from 1.341 to approximately 1.412, increasing the loading margin by roughly 446 MW.
6.6 Weak Bus Consolidation
| Bus | QV Rank | CPF: Nose First? | Modal p_k | Verdict |
|---|---|---|---|---|
| Bus 8 | 1st (38.4 Mvar) | Yes | 0.347 | CRITICAL |
| Bus 7 | 2nd (51.2 Mvar) | Yes (tied) | 0.298 | CRITICAL |
| Bus 4 | 3rd (67.8 Mvar) | No | 0.189 | WEAK |
| Bus 15 | 4th (89.3 Mvar) | No | 0.121 | MONITOR |
| Bus 3 | 5th (112.6 Mvar) | No | 0.083 | SECURE |
7.8 Full End-to-End Script
import sys, time import pandas as pd PF_PATH = r"C:\Program Files\DIgSILENT\PowerFactory 2023 SP4\Python\3.10" sys.path.insert(0, PF_PATH) import powerfactory as pf def main(): app = pf.GetApplicationExt() if not app: raise RuntimeError("Cannot connect") app.Show() app.ActivateProject("IEEE_39_Bus_VS_Study") # 1. Base load flow assert run_load_flow(app) == 0, "Load flow did not converge!" # 2. QV analysis load_buses = ["Bus 3", "Bus 4", "Bus 7", "Bus 8", "Bus 15", "Bus 16", "Bus 20", "Bus 21", "Bus 24", "Bus 27"] qv = run_qv_analysis(app, load_buses) # 3. CPF base = run_cpf(app) traj = extract_cpf_trajectory(app, ["Bus 8", "Bus 7", "Bus 4", "Bus 15"]) plot_pv_curves(traj, "PV Curves - IEEE 39-Bus (N-0)", "pv_curves_N0.png") # 4. N-1 sweep t0 = time.time() cont_df, _ = run_n1_contingency_sweep(app) print(f"Done in {time.time()-t0:.0f} s") # 5. Print summary print(f"Loading margin: {base['mw_margin']:.0f} MW (lambda={base['lambda_crit']:.3f})") for bus, d in sorted(qv.items(), key=lambda x: x[1]["Q_margin"] or 9999)[:5]: print(f" {bus:10s} {d['Q_margin']:6.1f} Mvar") # 6. Export export_to_excel(qv, cont_df, base, "VS_Study_39Bus_Results.xlsx") if __name__ == "__main__": main()
8. Interpreting Results and Margin Calculations
8.1 Reactive Power Margin
From QV curves, equation (1) gives Qmargin in Mvar for each load bus. Typical planning thresholds:
- N-0: Qmargin ≥ 0 Mvar (absolute minimum), ≥ 50 Mvar (planning standard)
- N-1: Qmargin ≥ 0 Mvar after worst credible single contingency
8.2 Voltage Margin
From CPF results, the voltage distance to collapse at each monitored bus:
A common criterion is ΔV ≥ 0.05–0.08 pu at all 220 kV and above buses.
8.3 Loading Margin
From equation (2), for the IEEE 39-bus system:
9. Common Pitfalls and How to Avoid Them
9.1 Generator Q-Limits Left at Default (±9999 Mvar)
If Qmax is left at 9999 Mvar — the PowerFactory default when machine data is not entered — generators supply unlimited reactive power and voltage collapse will never occur in simulation. Always enter realistic Qmin and Qmax from the machine datasheet or capability curve before running any VS study.
9.2 Wrong Load Type in CPF
Constant impedance loads become smaller as voltage drops (P ∝ V²), reducing reactive stress and giving optimistic results. For planning studies, always use constant power loads unless you have measured load characteristics for the specific system.
9.3 OLTC Behaviour During CPF
| Stability Type | Timescale | OLTC Setting in CPF |
|---|---|---|
| Short-term voltage stability | Seconds | OFF — OLTCs have not yet moved |
| Long-term voltage stability | Minutes | ON — OLTCs are part of the instability mechanism (runaway tapping) |
9.4 CPF Step Size Too Large
A large initial λ step can jump over the nose point entirely, causing PowerFactory to report “no nose found”. Use adaptive step size and set the initial step to ≤ 0.02 pu for stressed or radial networks.
9.5 Not Saving to an ElmRes Object
PowerFactory discards intermediate CPF results (the V vs. λ trajectory) after execution if no results object is assigned. The final λ_crit is stored in ComCpf but the full curves are gone. Always assign an ElmRes object in the Output tab before running.
9.6 Python API Attribute Names Vary by Version
API attribute strings such as "c:Qmargin", "m:u", "c:lambdacrit" can change between major versions. If GetAttribute() returns None, verify the name using the PowerFactory Variable Monitor or the Result Variable browser in the GUI.
9.7 Running CPF Without a Converged Load Flow
CPF is a predictor-corrector continuation of the load flow starting from a converged base point. If ComLdf has not been executed first — or if it failed — ComCpf fails immediately. Always call ldf.Execute() and verify the return code equals 0 before calling cpf.Execute().
References
- DIgSILENT GmbH, PowerFactory 2023 User Manual — Voltage Stability Analysis (ComVstab, ComCpf), Gomaringen, 2023.
- P. Kundur, Power System Stability and Control, McGraw-Hill, 1994 — Chapters 14–15 cover QV curve analysis and voltage collapse mechanisms.
- V. Ajjarapu and C. Christy, “The continuation power flow: a tool for steady state voltage stability analysis,” IEEE Trans. Power Systems, vol. 7, no. 1, pp. 416–423, Feb. 1992.
- B. Gao, G. K. Morison, P. Kundur, “Voltage stability evaluation using modal analysis,” IEEE Trans. Power Systems, vol. 7, no. 4, pp. 1529–1542, Nov. 1992.
- M. A. Pai, Computer Techniques in Power System Analysis, Tata McGraw-Hill, 1979 — source of IEEE 39-bus data.
- NERC, Voltage Stability Criteria, Undervoltage Load Shedding Strategy, and Reactive Power Reserve Practices, August 2006.
- C. A. Cañizares (ed.), “Voltage stability assessment: concepts, practices and tools,” IEEE-PES Power Systems Stability Subcommittee Special Publication SP101PSS, 2002.