Equipment Model Library
EnerOS has a built-in comprehensive power equipment model library covering major equipment types such as transmission lines, transformers, generators, loads, FACTS, and energy storage. The models follow IEC 61970 CIM and IEEE standards, and all parameters are represented as native Rust structs, avoiding runtime deserialization overhead.
The equipment model library is the “dictionary” of the EnerOS Power-Native kernel: topology tells us how the grid is connected, and equipment models tell us what is at the connections. Load flow calculation, protection setting, transient simulation, and constraint validation all depend on accurate electrical parameters provided by equipment models.
Architecture Overview
┌─────────────────────────────────────────────────┐
│ Application Layer: Load Flow / Protection / Transient / Planning │
└───────────────────┬─────────────────────────────┘
│ Equipment::get(id)
┌───────────────────┴─────────────────────────────┐
│ eneros-equipment (Equipment Model Library) │
│ ┌──────────┐ ┌──────────┐ ┌──────────────┐ │
│ │ Steady- │ │ Transient│ │ Real-Time │ │
│ │ State │ │ Model │ │ Domain Model │ │
│ └──────────┘ └──────────┘ └──────────────┘ │
│ ┌──────────────────────────────────────────┐ │
│ │ CIM / CGMES Interoperability Layer │ │
│ └──────────────────────────────────────────┘ │
│ ┌──────────────────────────────────────────┐ │
│ │ Versioning / Validation / Hot Swap │ │
│ └──────────────────────────────────────────┘ │
└─────────────────────────────────────────────────┘
Equipment Model Types
Transmission Line
Supports Π lumped-parameter and distributed-parameter (Bergeron model) representations.
use eneros_equipment::{TransmissionLine, LineModel, LineParams};
let line = TransmissionLine::new(LineParams {
r: 0.025, // Ω/km
x: 0.3, // Ω/km
b: 0.015, // μS/km
length: 150.0, // km
model: LineModel::Pi,
rating_mva: 500.0,
});
// Switch to distributed-parameter model (recommended for long lines)
let distributed_line = line.with_model(LineModel::Bergeron {
velocity: 2.9e8, // m/s traveling wave velocity
});
// Compute positive-sequence parameters
let z = line.series_impedance(); // Ω
let y = line.shunt_admittance(); // S
println!("Z = {:.4} Ω, Y = {:.2e} S", z, y);
LineParams Field Reference
| Field | Type | Meaning | Unit |
|---|---|---|---|
| r | f64 | Positive-sequence resistance per unit length | Ω/km |
| x | f64 | Positive-sequence reactance per unit length | Ω/km |
| b | f64 | Shunt susceptance per unit length | μS/km |
| length | f64 | Line length | km |
| model | LineModel | Pi / Bergeron / FrequencyDependent | - |
| rating_mva | f64 | Rated capacity | MVA |
| emergency_mva | f64 | Emergency capacity | MVA |
| g | f64 | Shunt conductance per unit length (optional) | μS/km |
| zero_r / zero_x / zero_b | f64 | Zero-sequence parameters (optional) | Ω/km, μS/km |
Transformer
Supports two-winding, three-winding, autotransformers, and tap-changer regulation (ULRTC).
use eneros_equipment::{Transformer, TransformerParams, TapChanger};
let xfmr = Transformer::new(TransformerParams {
sn_mva: 200.0,
v_hv_kv: 220.0,
v_lv_kv: 35.0,
z_percent: 12.5,
tap: TapChanger::automatic(0.95, 1.05, 17),
});
// Autotransformer
let auto = Transformer::autotransformer(TransformerParams {
sn_mva: 500.0,
v_hv_kv: 500.0,
v_lv_kv: 220.0,
z_percent: 10.0,
tap: TapChanger::automatic(0.90, 1.10, 25),
});
// Three-winding transformer
let three = Transformer::three_winding(
ThreeWindingParams {
s1_mva: 200.0, s2_mva: 200.0, s3_mva: 100.0,
v1_kv: 220.0, v2_kv: 110.0, v3_kv: 35.0,
z12_percent: 12.5, z13_percent: 15.0, z23_percent: 8.0,
},
);
TapChanger Types
| Variant | Meaning | Typical Use |
|---|---|---|
| None | No tap changer | Distribution transformer with small ratio |
| Fixed(ratio) | Fixed ratio | Planning calculations |
| Manual(tap_idx, range) | Manual regulation | Offline analysis |
| Automatic(min, max, steps) | Automatic voltage regulation | Online operation |
| OnLoad(tap_idx, range, deadband) | On-load tap changing | Real-time control |
Generator
Supports the synchronous machine six-order model (IEEE Std 1110), excitation systems (IEEE Type ST1/AC4A), governors (GOV1), and PSS.
use eneros_equipment::{SynchronousMachine, GenModel, ExciterType, GovernorType, PssType};
let gen = SynchronousMachine::new()
.model(GenModel::GENROU)
.rating_mva(600.0)
.xd(1.8).xq(1.7).xd_prime(0.3).xq_prime(0.55)
.inertia_h(5.0)
.damping_d(0.0)
.exciter(ExciterType::ST1A)
.governor(GovernorType::GOV1)
.pss(PssType::PSS2A);
// Compute synchronous speed and inertia constant
let m = gen.inertia_constant(); // MJ·s/MVA
let sn = gen.rated_speed_rad(); // rad/s (50Hz)
println!("H = {:.2} s, ωn = {:.2} rad/s", m, sn);
GenModel Variants
| Variant | Order | Applicable Scenario |
|---|---|---|
| GENROU | 6th order (salient pole) | Detailed transient stability modeling |
| GENSAL | 5th order (round rotor) | Steam turbine |
| GENSAE | 4th order | Simplified transient |
| GENTPF | 3rd order | Long-term dynamics |
| CLASSICAL | 2nd order (constant EMF behind transient reactance) | Planning-level rough calculation |
| SC_2_ORDER | 2nd-order short-circuit model | Fault calculation |
Load Model
Supports ZIP, exponential, induction motor, and composite load (CLOD) models.
use eneros_equipment::{Load, LoadModel};
// ZIP load model
let zip_load = Load::new(bus_id)
.model(LoadModel::ZIP {
a_p: 0.4, b_p: 0.4, c_p: 0.2,
a_q: 0.5, b_q: 0.3, c_q: 0.2,
})
.p_mw(50.0)
.q_mvar(15.0);
// Exponential load model
let exp_load = Load::new(bus_id)
.model(LoadModel::Exponential { alpha: 1.5, beta: 2.0 })
.p_mw(30.0)
.q_mvar(10.0);
// Induction motor load (IEEE 5th order)
let motor_load = Load::new(bus_id)
.model(LoadModel::InductionMotor {
rs: 0.02, xs: 0.10, rr: 0.02, xr: 0.10, xm: 3.5,
inertia_h: 1.0,
})
.p_mw(20.0)
.q_mvar(5.0);
Energy Storage and FACTS
Supports battery energy storage (BESS), SVG/STATCOM, TCSC, UPFC, and other devices.
use eneros_equipment::{Bess, Statcom, Tcsc, Upfc, StatcomMode};
let bess = Bess::new()
.capacity_mwh(20.0)
.power_mw(10.0)
.soc_range(0.2, 0.9)
.efficiency_charge(0.95)
.efficiency_discharge(0.93)
.degradation_model(DegradationModel::Linear { cycles: 6000 });
let statcom = Statcom::new()
.rating_mvar(50.0)
.control_mode(StatcomMode::Voltage(1.0))
.response_time_ms(20);
let tcsc = Tcsc::new()
.rating_mvar(200.0)
.compensation_range(-0.5, 0.5)
.control_mode(TcscMode::PowerFlow(150.0));
let upfc = Upfc::new()
.shunt_mvar(100.0)
.series_mvar(50.0)
.control_mode(UpfcMode::VoltageAndFlow(1.0, 200.0));
CIM Compatibility
The equipment library is fully interoperable with IEC 61970 CIM and supports CIM XML / CGMES import and export:
use eneros_equipment::cim::{CimImporter, CimExporter, CimProfile};
// Import from CIM XML
let network = CimImporter::new()
.profile(CimProfile::Eq) // Equipment
.from_xml_file("grid.xml")?;
// Import from CGMES (multiple files)
let network = CimImporter::new()
.profile(CimProfile::EqBoundary)
.from_cgmes_bundle("EQ.xml", "TP.xml", "SV.xml", "SSH.xml")?;
// Export to CGMES
let xml = CimExporter::to_cgmes(&network, CimProfile::Eq)?;
std::fs::write("export_eq.xml", xml)?;
// Export to CIM JSON
let json = CimExporter::to_json(&network)?;
CIM Compatibility Matrix
| CIM Version | Import | Export | Profiles |
|---|---|---|---|
| IEC 61970-301 v6 | ✅ | ✅ | Core, Topology, Equivalents |
| CGMES 2.4.15 | ✅ | ✅ | EQ, TP, SV, SSH, DY |
| CGMES 3.0.0 | ✅ | ✅ | EQ, TP, SV, SSH, DY |
| OpenFMB 2.0 | ✅ | Partial | Wire, LoadControl |
Model Versioning
Each equipment model supports versioning for easy rollback and comparison:
use eneros_equipment::Version;
let gen_v1 = gen.with_version(Version::new("v2.3-ieee1110"));
let gen_v2 = gen.with_version(Version::new("v2.4-calibrated"));
// History
let history = gen.version_history();
for v in &history {
println!("{}: {} @ {}", v.tag, v.checksum, v.created_at);
}
// Compare two versions
let diff = gen_v1.diff(&gen_v2)?;
println!("Changed fields: {:?}", diff.changed_fields);
// Roll back to a historical version
gen.rollback_to("v2.3-ieee1110").await?;
Parameter Hot Swap
Supports replacing equipment parameters without stopping, commonly used for online calibration:
use eneros_equipment::HotSwap;
// Replace line parameters (topology unchanged)
HotSwap::replace_line_params(line_id, new_params).await?;
// Replace generator model (keep running state)
HotSwap::replace_gen_model(gen_id, GenModel::GENSAE).await?;
// After replacement, the kernel automatically:
// 1. Invalidates the load flow cache
// 2. Triggers constraint recomputation
// 3. Notifies subscribed Agents
Equipment Parameter Validation
The equipment library has built-in physical consistency validation to prevent unreasonable parameters:
use eneros_equipment::Validator;
let report = Validator::new()
.check_impedance_positive()
.check_thermal_rating()
.check_voltage_class()
.validate(&network)?;
for issue in &report.issues {
println!("[{:?}] {}: {}", issue.level, issue.element, issue.message);
}
Validation Items
| Validation Item | Check Content | Level |
|---|---|---|
| impedance_positive | R ≥ 0, X > 0 | Error |
| thermal_rating | rating_mva > 0 | Error |
| voltage_class | base_kv is consistent with the grid | Error |
| transformer_ratio | tap is within a reasonable range | Warning |
| generator_capacity | S_n ≥ P_max | Warning |
| load_power_factor | cos(φ) ∈ [0, 1] | Warning |
| zero_sequence_consistency | Zero-sequence parameters are reasonable | Warning |
Performance Metrics
| Operation | Latency | Throughput |
|---|---|---|
| Create transmission line model | < 1μs | - |
| Create transformer model | < 2μs | - |
| Create generator 6th-order model | < 5μs | - |
| Create load model | < 1μs | - |
| Create energy storage model | < 3μs | - |
| CIM import (10000 devices) | - | < 500ms |
| CGMES export (10000 devices) | - | < 800ms |
| Equipment parameter hot swap | < 100μs | - |
| Parameter validation (1000 devices) | < 50ms | - |
| Equipment query (by ID) | < 1μs | - |
Test environment: 4 cores / 8GB / Ubuntu 22.04.
Equipment Coverage Matrix
| Equipment Type | Steady-State Model | Transient Model | Real-Time Domain | CIM |
|---|---|---|---|---|
| Transmission line | Π / Distributed parameter | Bergeron | ✅ | ✅ |
| Transformer | T-model | With saturation | ✅ | ✅ |
| Synchronous machine | PV/PQ | GENROU/GENSAL | ✅ | ✅ |
| Induction machine | Equivalent impedance | 5th-order model | ✅ | Partial |
| Energy storage | Static | 1st-order + SOC | ✅ | Partial |
| FACTS (STATCOM) | PF control | Detailed | ✅ | Partial |
| FACTS (TCSC) | Series compensation | 1st-order | ✅ | Partial |
| FACTS (UPFC) | PF + V control | Detailed | ✅ | Partial |
| HVDC (LCC/VSC) | Quasi-steady-state | Detailed | ✅ | ✅ |
| Circuit breaker | Open/close status | Contact dynamics | ✅ | ✅ |
| Surge arrester | Static V-I | Detailed | ✅ | ✅ |
Configuration Parameters
Equipment library-related configuration in eneros.toml:
[equipment]
# Default model fidelity: detailed / simplified / auto
default_fidelity = "auto"
# Whether to enable parameter validation
validate_on_load = true
# Whether to enable versioning
versioning = true
# Maximum number of versions
max_versions = 32
# CIM import strictness: strict / lenient
cim_strictness = "strict"
# Default line model: pi / bergeron / frequency_dependent
default_line_model = "pi"
# Whether to allow hot swap
hot_swap = true
| Parameter | Type | Default | Description |
|---|---|---|---|
| default_fidelity | enum | auto | Default model fidelity |
| validate_on_load | bool | true | Validate on load |
| versioning | bool | true | Enable versioning |
| max_versions | u32 | 32 | Maximum number of versions per device |
| cim_strictness | enum | strict | CIM import strictness |
| default_line_model | enum | pi | Default line model |
| hot_swap | bool | true | Allow hot-swapping parameters |
Relationship with Other Capabilities
| Related Capability | Interaction |
|---|---|
| Grid Topology First-Class Citizen | Equipment instances are the equipment parameters of topology nodes |
| Physical Constraint Decision | Thermal stability limits come from equipment rating_mva |
| Real-Time Dual Execution Domain | The real-time domain uses dedicated simplified models |
| Digital Twin Engine | Twin mirrors use equipment models for simulation |
| Safety Guard | Operation ticket validation checks equipment status |
| Time-Series Native Operations | Equipment parameter change events are ingested |
| Multi-tenant and Isolation | Equipment is isolated per tenant namespace |
Related Documentation
- Grid Topology First-Class Citizen — Equipment is the topology node
- Grid Analysis Advanced — Equipment models drive analysis
- Real-Time Dual Execution Domain — Real-time domain equipment models
- Digital Twin Engine — Equipment models drive simulation
- EnerOS Introduction — Power-Native First design philosophy