pub struct Contingency {
pub id: String,
pub label: String,
pub branch_indices: Vec<usize>,
pub generator_indices: Vec<usize>,
pub hvdc_converter_indices: Vec<usize>,
pub hvdc_cable_indices: Vec<usize>,
pub switch_ids: Vec<String>,
pub tpl_category: TplCategory,
pub modifications: Vec<ContingencyModification>,
}Expand description
A single contingency definition (one or more element outages).
Fields§
§id: StringUnique identifier (e.g. “branch_42”).
label: StringHuman-readable label (e.g. “Line 123->456 (ckt 1)”).
branch_indices: Vec<usize>Branch indices to trip (usually 1 for N-1).
generator_indices: Vec<usize>Generator indices to trip (empty for branch-only N-1).
hvdc_converter_indices: Vec<usize>HVDC converter indices to trip (for HVDC contingencies).
Each index refers to the position in the HVDC link list extracted from
the network (via hvdc_links_from_network). Tripping a converter
removes its P/Q injection at both the rectifier and inverter buses.
hvdc_cable_indices: Vec<usize>HVDC cable (DC branch) indices to trip (for HVDC contingencies).
Tripping a DC cable removes the P injection at both ends of the corresponding HVDC link, equivalent to setting P_dc = 0 for that link.
switch_ids: Vec<String>Switch mRIDs to toggle for breaker contingencies.
When non-empty this is a breaker contingency that requires topology
re-reduction (via surge_topology::rebuild_topology) before power flow.
Each entry is the mRID of a switch to open (for trip contingencies) or
close (for restoration studies).
tpl_category: TplCategoryNERC TPL-001-5.1 category classification.
Set by the P4/P5/P6 contingency generators; defaults to Unclassified
for standard N-1/N-2 contingencies.
modifications: Vec<ContingencyModification>Simultaneous network modifications (PSS/E .con SET/CHANGE commands).
Applied to the per-contingency network clone immediately after element outages, before the post-contingency power flow is solved. Empty for standard N-1/N-2 contingencies.
Trait Implementations§
Source§impl Clone for Contingency
impl Clone for Contingency
Source§fn clone(&self) -> Contingency
fn clone(&self) -> Contingency
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more