Continuation power flow (PV and QV curves)#

solve_pv_curve(case, sink, source=None, *, options=PfContinuationOptions(limit_mode='enforce', maximum_mode='pin', initial_step=0.1, minimum_voltage_pu=0.2, point_limit=200, corrector_tolerance=1e-09, solve_options=PfSolveOptions(max_iter=50, tol=1e-06, q_tol=1e-08, var_limit_start='immediate', ac_tap_adjust='enabled', lcc_dc_tap_adjust='enabled', phase_shift_adjust='enabled', swshunt_adjust='enabled', low_voltage_load_pu=0.0)), stop_mw=None, backend=None, progress=None)#

Calculate a PV curve and report its loading margin.

Parameters:
  • case -- Solved or unsolved case at the required starting condition.

  • sink -- Bus number or positive {bus: weight} mapping where active and reactive load increase at the base power factor.

  • source -- Optional bus number or positive {bus: weight} mapping that supplies the active-power increase. None uses the case balancing resource.

  • options -- Limit treatment, maximum reporting method, curve step, and stop conditions.

  • stop_mw -- Stop after the added transfer exceeds this positive MW value. None disables this stop.

  • backend -- Solver backend. None uses normal backend selection.

  • progress -- Optional callable that receives the study's progress frame and the solver's control reviews. A true result stops the study.

Returns:

Added transfer in MW and bus voltages for each curve point, the reported loading margin, the limiting condition, weak-location indicators, and customer-visible warnings.

Raises:

DCOPFError -- The request is invalid, the start does not solve, or the case contains a feature that this study does not support.

class PvCurve(nose_kind, nose_mw, pinned, weak_bus, lam_mw, lam_dot, vm_min, regime_change, vm, bus_ids, nose_vm, weak_ranking=(), participation=(), sbase=100.0)#

Store a PV curve and its reported loading margin.

lam_mw contains the added transfer at each reported point. vm contains bus-voltage magnitudes for those points. bus_ids defines the voltage column order. The result also identifies the reported maximum, limiting condition, weak location, and customer-visible warnings.

curve(bus)#

Return loading and voltage samples for one bus's PV curve.

doc()#

Return the result document: the nose record, a chart declaration over the traced points, and the column bindings for the row-tables (points / weak_ranking / participation), which live on the queryable slot and are queried in SQL. The reply attaches the table the chart names, so the document stores no copy of it.

margin_mw is null when the trace crossed no maximum. The chart's marker reads that value, so such a run draws no marker.

as_tables()#

Row-tables for the SQL query surface: points (the traced curve -- transfer MW, min voltage per point), weak_ranking / participation (the fold null-vector rankings).

classmethod column_quantities()#

Return the quantity each points column binds, keyed by table and column name.

as_tables() names lam_mw and vm_min, so this class says what those columns measure. Each column's label, unit, and type follow from its quantity, and a chart titles its axes from them.

to_markdown(path=None, top=10)#

Return the PV curve summary as Markdown.

solve_qv_curve(case, bus, *, options=PfContinuationOptions(limit_mode='enforce', maximum_mode='pin', initial_step=0.1, minimum_voltage_pu=0.2, point_limit=200, corrector_tolerance=1e-09, solve_options=PfSolveOptions(max_iter=50, tol=1e-06, q_tol=1e-08, var_limit_start='immediate', ac_tap_adjust='enabled', lcc_dc_tap_adjust='enabled', phase_shift_adjust='enabled', swshunt_adjust='enabled', low_voltage_load_pu=0.0)), stop_mvar=None, backend=None, progress=None)#

Calculate a QV curve and report its reactive margin.

Each point applies additional reactive withdrawal at the study bus. The reported margin is the withdrawal at the calculated curve bottom.

Parameters:
  • case -- Solved or unsolved case at the required starting condition.

  • bus -- Case bus number for the reactive-power withdrawal.

  • options -- Limit treatment, maximum reporting method, curve step, and stop conditions.

  • stop_mvar -- Stop after the added withdrawal exceeds this positive Mvar value. None disables this stop.

  • backend -- Solver backend. None uses normal backend selection.

  • progress -- Optional callable that receives the study's progress frame and the solver's control reviews. A true result stops the study.

Returns:

Reactive injection in Mvar and voltage magnitude for each curve point, the reported margin, the limiting condition, weak-location indicators, and customer-visible warnings.

Raises:

DCOPFError -- The request is invalid, the study bus has no available reactive equation, the start does not solve, or the case contains an unsupported feature.

class QvCurve(bus, margin_mvar, nose_kind, pinned, v, q_inj_mvar, v_bottom, weak_ranking=(), participation=(), sbase=100.0)#

Store a QV curve and its reported reactive margin.

v contains voltage magnitude at the study bus. q_inj_mvar contains the corresponding reactive injection in Mvar. The result also identifies the reported margin, limiting condition, weak location, and customer-visible warnings.

doc()#

Return the result document: the study bus, the nose record, a chart declaration over the traced points, and the column bindings for the row-tables (points / weak_ranking / participation), which live on the queryable slot and are queried in SQL. The reply attaches the table the chart names, so the document stores no copy of it.

v_bottom is null when the trace crossed no bottom. The chart's marker reads that value, so such a run draws no marker.

as_tables()#

Row-tables for the SQL query surface: points (the traced curve -- bus voltage, injected Mvar per point), weak_ranking / participation (the fold null-vector rankings).

classmethod column_quantities()#

Return the quantity each points column binds, keyed by table and column name.

as_tables() names v and q_inj_mvar, so this class says what those columns measure. Each column's label, unit, and type follow from its quantity, and a chart titles its axes from them.

to_markdown(path=None, top=10)#

Return the QV curve summary as Markdown.