pub enum NetworkError {
Show 47 variants
EmptyNetwork,
InvalidBaseMva(f64),
DuplicateBusNumber(u32),
NoSlackBus,
InvalidBranchEndpoint {
branch_from: u32,
branch_to: u32,
missing_bus: u32,
},
SelfLoopBranch(u32),
InvalidGeneratorBus(u32),
InvalidGeneratorRegulatedBus {
bus: u32,
reg_bus: u32,
},
InvalidLoadBus(u32),
InvalidPowerInjectionBus(u32),
InvalidFixedShuntBus(u32),
InvalidDispatchableLoadBus(u32),
DuplicateGeneratorId {
id: String,
},
InvalidSwitchedShuntBus {
id: String,
bus: u32,
},
InvalidSwitchedShuntRegulatedBus {
id: String,
bus: u32,
},
InvalidSwitchedShuntOpfBus {
id: String,
bus: u32,
},
InvalidGeneratorLimits {
bus: u32,
},
InvalidGeneratorReactiveLimits {
bus: u32,
},
InvalidStorageParameters {
bus: u32,
source: StorageValidationError,
},
InvalidBusField {
bus: u32,
field: &'static str,
value: f64,
},
InvalidLoadField {
bus: u32,
field: &'static str,
value: f64,
},
InvalidFixedShuntField {
bus: u32,
field: &'static str,
value: f64,
},
InvalidPowerInjectionField {
bus: u32,
field: &'static str,
value: f64,
},
InvalidGeneratorField {
bus: u32,
field: &'static str,
value: f64,
},
InvalidBranchField {
from_bus: u32,
to_bus: u32,
field: &'static str,
value: f64,
},
InvalidBranchAngleBounds {
from_bus: u32,
to_bus: u32,
min_rad: Option<f64>,
max_rad: Option<f64>,
},
InvalidSlackPlacement {
buses: Vec<u32>,
slack_buses: Vec<u32>,
},
InvalidIsolatedBusConnectivity {
bus: u32,
},
NonFiniteBusVoltage(u32),
InvalidBusVoltageBounds(u32, f64, f64),
NonFiniteBranchImpedance(u32, u32),
DuplicateBranchKey {
from_bus: u32,
to_bus: u32,
circuit: String,
},
MissingTopologyMapping,
StaleNodeBreakerTopology,
InvalidInterfaceDefinition {
name: String,
detail: String,
},
InvalidFlowgateDefinition {
name: String,
detail: String,
},
DuplicateAreaScheduleNumber(u32),
InvalidAreaScheduleSlackBus {
area: u32,
slack_bus: u32,
},
InvalidAreaScheduleField {
area: u32,
field: &'static str,
value: f64,
},
DuplicateHvdcLinkName {
name: String,
},
InvalidHvdcLinkEndpoint {
name: String,
bus: u32,
},
DuplicateDcGridId {
id: u32,
},
DuplicateDcBusId {
grid_id: u32,
bus_id: u32,
},
InvalidDcConverterAcBus {
grid_id: u32,
ac_bus: u32,
},
InvalidDcConverterDcBus {
grid_id: u32,
dc_bus: u32,
},
InvalidDcBranchEndpoint {
grid_id: u32,
from_bus: u32,
to_bus: u32,
missing_bus: u32,
},
MixedHvdcRepresentation,
}Expand description
Structured error type returned by Network::validate.
Variants§
EmptyNetwork
The network has no buses.
InvalidBaseMva(f64)
base_mva is not positive or not finite.
DuplicateBusNumber(u32)
Two or more buses share the same external bus number.
NoSlackBus
No bus has BusType::Slack (every network needs at least one angle reference).
InvalidBranchEndpoint
A branch references a bus number that does not exist in the bus list.
SelfLoopBranch(u32)
A branch has the same bus on both ends.
InvalidGeneratorBus(u32)
A generator references a bus number not present in the bus list.
InvalidGeneratorRegulatedBus
A generator references a remote regulated bus number not present in the bus list.
InvalidLoadBus(u32)
A load references a bus number not present in the bus list.
InvalidPowerInjectionBus(u32)
A power injection references a bus number not present in the bus list.
InvalidFixedShuntBus(u32)
A fixed shunt references a bus number not present in the bus list.
InvalidDispatchableLoadBus(u32)
A dispatchable load references a bus number not present in the bus list.
DuplicateGeneratorId
Two generators share the same canonical ID (after whitespace trimming).
InvalidSwitchedShuntBus
A switched shunt references a missing host bus.
InvalidSwitchedShuntRegulatedBus
A switched shunt references a missing regulated bus.
InvalidSwitchedShuntOpfBus
A switched-shunt OPF relaxation references a missing host bus.
InvalidGeneratorLimits
A generator has pmin > pmax.
InvalidGeneratorReactiveLimits
A generator has qmin > qmax.
InvalidStorageParameters
A storage-capable generator has invalid StorageParams (e.g. negative capacity).
InvalidBusField
A bus field required for solve readiness is not finite or out of range.
InvalidLoadField
A load field required for solve readiness is not finite or out of range.
InvalidFixedShuntField
A fixed shunt field required for solve readiness is not finite or out of range.
InvalidPowerInjectionField
A power injection field required for solve readiness is not finite or out of range.
InvalidGeneratorField
A generator field required for solve readiness is not finite or out of range.
InvalidBranchField
A branch field required for solve readiness is not finite or out of range.
InvalidBranchAngleBounds
Branch angle-difference limits are finite but inverted.
InvalidSlackPlacement
A bus component does not have exactly one slack bus.
InvalidIsolatedBusConnectivity
An isolated bus is still connected by an in-service branch.
NonFiniteBusVoltage(u32)
A bus has NaN or Inf in its voltage magnitude or angle initial condition.
InvalidBusVoltageBounds(u32, f64, f64)
A bus has non-finite or inverted voltage bounds (vmin > vmax).
NonFiniteBranchImpedance(u32, u32)
A branch has NaN or Inf in r, x, b, or tap.
DuplicateBranchKey
Two or more branches share the same (from_bus, to_bus, circuit) key.
MissingTopologyMapping
Node-breaker topology is present but no bus-branch mapping has been built yet.
StaleNodeBreakerTopology
Node-breaker topology mapping is stale (switches changed since last rebuild).
InvalidInterfaceDefinition
An interface uses mismatched or invalid branch/coefficient metadata.
InvalidFlowgateDefinition
A flowgate uses mismatched or invalid monitored branch/coefficient metadata.
DuplicateAreaScheduleNumber(u32)
Two or more area schedules share the same area number.
InvalidAreaScheduleSlackBus
An area schedule references a missing or invalid slack bus.
InvalidAreaScheduleField
An area-schedule field required for runtime correctness is invalid.
DuplicateHvdcLinkName
Two or more point-to-point HVDC links share the same stable name.
InvalidHvdcLinkEndpoint
A point-to-point HVDC link references a missing AC bus.
DuplicateDcGridId
Two explicit DC grids share the same canonical grid id.
DuplicateDcBusId
Two buses inside the same explicit DC grid share the same bus id.
InvalidDcConverterAcBus
An explicit DC-grid converter references a missing AC bus.
InvalidDcConverterDcBus
An explicit DC-grid converter references a missing DC bus.
InvalidDcBranchEndpoint
An explicit DC-grid branch references a missing DC bus.
MixedHvdcRepresentation
A solve-ready network mixes the two canonical HVDC representations.
Trait Implementations§
Source§impl Debug for NetworkError
impl Debug for NetworkError
Source§impl Display for NetworkError
impl Display for NetworkError
Source§impl Error for NetworkError
impl Error for NetworkError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()