pub struct OpfSolution {Show 30 fields
pub opf_type: OpfType,
pub base_mva: f64,
pub power_flow: PfSolution,
pub total_cost: f64,
pub total_load_mw: f64,
pub total_generation_mw: f64,
pub total_losses_mw: f64,
pub generators: OpfGeneratorResults,
pub pricing: OpfPricing,
pub branches: OpfBranchResults,
pub devices: OpfDeviceDispatch,
pub par_results: Vec<ParResult>,
pub virtual_bid_results: Vec<VirtualBidResult>,
pub benders_cut_duals: Vec<f64>,
pub objective_terms: Vec<ObjectiveTerm>,
pub audit: SolutionAuditReport,
pub bus_q_slack_pos_mvar: Vec<f64>,
pub bus_q_slack_neg_mvar: Vec<f64>,
pub bus_p_slack_pos_mw: Vec<f64>,
pub bus_p_slack_neg_mw: Vec<f64>,
pub vm_slack_high_pu: Vec<f64>,
pub vm_slack_low_pu: Vec<f64>,
pub angle_diff_slack_high_rad: Vec<f64>,
pub angle_diff_slack_low_rad: Vec<f64>,
pub solve_time_secs: f64,
pub iterations: Option<u32>,
pub solver_name: Option<String>,
pub solver_version: Option<String>,
pub ac_opf_timings: Option<AcOpfTimings>,
pub nlp_trace: Option<NlpTrace>,
}Expand description
Result of an Optimal Power Flow computation.
Fields§
§opf_type: OpfTypeOPF formulation type; required for correct interpretation of all other fields.
base_mva: f64System MVA base used to convert MW/MVAr values to per-unit.
power_flow: PfSolutionUnderlying power flow solution (voltages, injections, branch flows).
total_cost: f64Total objective cost for the solved interval (dollars).
total_load_mw: f64Total system load (MW).
total_generation_mw: f64Total generation (MW).
total_losses_mw: f64Total system losses (MW). Zero for DC-OPF.
generators: OpfGeneratorResultsGenerator dispatch and dual values.
pricing: OpfPricingLMP decomposition.
branches: OpfBranchResultsBranch-level results and constraint duals.
devices: OpfDeviceDispatchFACTS device, storage, and transformer dispatch.
par_results: Vec<ParResult>PAR implied shift angles.
virtual_bid_results: Vec<VirtualBidResult>Virtual bid clearing results.
benders_cut_duals: Vec<f64>Benders cut dual values from AC-SCOPF.
objective_terms: Vec<ObjectiveTerm>Exact objective decomposition.
audit: SolutionAuditReportPersisted exact-audit status for this solution payload.
bus_q_slack_pos_mvar: Vec<f64>Per-bus reactive-power balance slack (positive direction, MVAr).
Entry i corresponds to bus index i in the network. Non-empty
only when bus_reactive_power_balance_slack_penalty_per_mvar > 0.
bus_q_slack_neg_mvar: Vec<f64>Per-bus reactive-power balance slack (negative direction, MVAr).
bus_p_slack_pos_mw: Vec<f64>Per-bus active-power balance slack (positive direction, MW).
bus_p_slack_neg_mw: Vec<f64>Per-bus active-power balance slack (negative direction, MW).
vm_slack_high_pu: Vec<f64>Per-bus voltage-magnitude high slack (pu), one per bus.
σ_high[i] = max(0, vm[i] - vm_max[i]). Non-empty only when
voltage_magnitude_slack_penalty_per_pu > 0.
vm_slack_low_pu: Vec<f64>Per-bus voltage-magnitude low slack (pu), one per bus.
σ_low[i] = max(0, vm_min[i] - vm[i]).
angle_diff_slack_high_rad: Vec<f64>Per-branch angle-difference high slack (radians), indexed by network branch order.
sigma_high[i] allows Va_from - Va_to to exceed angmax by this amount.
Non-empty only when angle_difference_slack_penalty_per_rad > 0.
angle_diff_slack_low_rad: Vec<f64>Per-branch angle-difference low slack (radians), indexed by network branch order.
sigma_low[i] allows Va_from - Va_to to go below angmin by this amount.
solve_time_secs: f64Total solve time in seconds.
iterations: Option<u32>Number of solver iterations, when the backend exposes it.
solver_name: Option<String>Name of the LP/NLP solver (e.g. "HiGHS", "Gurobi", "Ipopt").
solver_version: Option<String>Version string of the solver.
ac_opf_timings: Option<AcOpfTimings>Per-phase timing breakdown within the OPF solve.
nlp_trace: Option<NlpTrace>NLP solver stats and final-iterate diagnostics. Populated by the NLP backend (Ipopt today). Captures problem size, termination status, and residuals/barrier at the final iterate so post-mortem analysis can distinguish convergence/infeasibility/iteration-limit cases without parsing log strings.
Implementations§
Source§impl OpfSolution
impl OpfSolution
Sourcepub fn audit(&self) -> &SolutionAuditReport
pub fn audit(&self) -> &SolutionAuditReport
Persisted exact-audit status stored on the serialized solution payload.
Sourcepub fn has_objective_ledger(&self) -> bool
pub fn has_objective_ledger(&self) -> bool
Whether this solution carries an exact objective ledger that can be audited.
Sourcepub fn refresh_audit(&mut self)
pub fn refresh_audit(&mut self)
Recompute and store the persisted audit block from the exact
objective ledger. Gated by the SURGE_OBJECTIVE_AUDIT env var —
see crate::objective_audit_enabled. When the gate is off
(the default), this is a no-op and the audit field stays at
its serde default.
Sourcepub fn objective_ledger_mismatches(&self) -> Vec<ObjectiveLedgerMismatch>
pub fn objective_ledger_mismatches(&self) -> Vec<ObjectiveLedgerMismatch>
Return every objective-ledger mismatch found on this OPF solution.
Sourcepub fn objective_ledger_is_consistent(&self) -> bool
pub fn objective_ledger_is_consistent(&self) -> bool
Whether the OPF solution’s exact objective ledger reconciles cleanly.
Trait Implementations§
Source§impl AuditableSolution for OpfSolution
impl AuditableSolution for OpfSolution
fn computed_solution_audit(&self) -> SolutionAuditReport
Source§impl Clone for OpfSolution
impl Clone for OpfSolution
Source§fn clone(&self) -> OpfSolution
fn clone(&self) -> OpfSolution
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more