Skip to main content

Equipment Model Library

Capabilities

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

FieldTypeMeaningUnit
rf64Positive-sequence resistance per unit lengthΩ/km
xf64Positive-sequence reactance per unit lengthΩ/km
bf64Shunt susceptance per unit lengthμS/km
lengthf64Line lengthkm
modelLineModelPi / Bergeron / FrequencyDependent-
rating_mvaf64Rated capacityMVA
emergency_mvaf64Emergency capacityMVA
gf64Shunt conductance per unit length (optional)μS/km
zero_r / zero_x / zero_bf64Zero-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

VariantMeaningTypical Use
NoneNo tap changerDistribution transformer with small ratio
Fixed(ratio)Fixed ratioPlanning calculations
Manual(tap_idx, range)Manual regulationOffline analysis
Automatic(min, max, steps)Automatic voltage regulationOnline operation
OnLoad(tap_idx, range, deadband)On-load tap changingReal-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

VariantOrderApplicable Scenario
GENROU6th order (salient pole)Detailed transient stability modeling
GENSAL5th order (round rotor)Steam turbine
GENSAE4th orderSimplified transient
GENTPF3rd orderLong-term dynamics
CLASSICAL2nd order (constant EMF behind transient reactance)Planning-level rough calculation
SC_2_ORDER2nd-order short-circuit modelFault 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 VersionImportExportProfiles
IEC 61970-301 v6Core, Topology, Equivalents
CGMES 2.4.15EQ, TP, SV, SSH, DY
CGMES 3.0.0EQ, TP, SV, SSH, DY
OpenFMB 2.0PartialWire, 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 ItemCheck ContentLevel
impedance_positiveR ≥ 0, X > 0Error
thermal_ratingrating_mva > 0Error
voltage_classbase_kv is consistent with the gridError
transformer_ratiotap is within a reasonable rangeWarning
generator_capacityS_n ≥ P_maxWarning
load_power_factorcos(φ) ∈ [0, 1]Warning
zero_sequence_consistencyZero-sequence parameters are reasonableWarning

Performance Metrics

OperationLatencyThroughput
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 TypeSteady-State ModelTransient ModelReal-Time DomainCIM
Transmission lineΠ / Distributed parameterBergeron
TransformerT-modelWith saturation
Synchronous machinePV/PQGENROU/GENSAL
Induction machineEquivalent impedance5th-order modelPartial
Energy storageStatic1st-order + SOCPartial
FACTS (STATCOM)PF controlDetailedPartial
FACTS (TCSC)Series compensation1st-orderPartial
FACTS (UPFC)PF + V controlDetailedPartial
HVDC (LCC/VSC)Quasi-steady-stateDetailed
Circuit breakerOpen/close statusContact dynamics
Surge arresterStatic V-IDetailed

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
ParameterTypeDefaultDescription
default_fidelityenumautoDefault model fidelity
validate_on_loadbooltrueValidate on load
versioningbooltrueEnable versioning
max_versionsu3232Maximum number of versions per device
cim_strictnessenumstrictCIM import strictness
default_line_modelenumpiDefault line model
hot_swapbooltrueAllow hot-swapping parameters

Relationship with Other Capabilities

Related CapabilityInteraction
Grid Topology First-Class CitizenEquipment instances are the equipment parameters of topology nodes
Physical Constraint DecisionThermal stability limits come from equipment rating_mva
Real-Time Dual Execution DomainThe real-time domain uses dedicated simplified models
Digital Twin EngineTwin mirrors use equipment models for simulation
Safety GuardOperation ticket validation checks equipment status
Time-Series Native OperationsEquipment parameter change events are ingested
Multi-tenant and IsolationEquipment is isolated per tenant namespace