Skip to main content

run_power_flow

Function run_power_flow 

Source
pub fn run_power_flow(
    buses: Vec<Bus>,
    lines: &[Line],
    transformers: &[Transformer],
    shunts: &[ShuntAdm],
    taps: TapData<'_>,
    opts: PowerFlowOptions,
) -> PowerFlowReport
Expand description

Runs a power flow by the method named in opts.

Takes branch lists rather than a finished Y-bus because PowerFlowMethod::Dc is formulated per branch — it needs each branch’s own x and tap, which a Y-bus has already summed away — and never builds one at all. The other two methods assemble their Y-bus here, from these same lists plus shunts.

run_power_flow_analysis and run_power_flow_analysis_from_ybus are unchanged and remain the shortest path to an ordinary Newton solve; PowerFlowOptions::default() here reproduces exactly what they do.