OpenDSS Distribution Grids & DERs (.dss)
@modelscript/opendss (languages/opendss) provides zero-regex parsing, unbalanced multi-phase power flow solving, distributed energy resource (DER) hosting capacity analysis, linear DAE lowering, and Modelica 3.x projection for EPRI OpenDSS radial and meshed electrical distribution networks.
Supported Extensions & Standards
| Extension | Format | Description |
|---|---|---|
.dss | OpenDSS Command Deck | Distribution grid feeders, multi-phase line codes, transformers, distributed PV/wind, and loads |
Key Capabilities
1. Multi-Phase Unbalanced AC Power Flow
- Solves unbalanced radial and weakly meshed 3-phase/4-wire distribution networks via the nodal admittance matrix (
) formulation and Forward-Backward Sweep (FBS): - Models constant power (
), constant current ( ), and constant impedance ( ) loads: - Accurately tracks mutual coupling across multi-conductor overhead lines and underground concentric neutral cables using Carson's equations for earth return path impedance.
2. DER Hosting Capacity & Reverse Power Flow
- Models distributed solar photovoltaic (PVSystem) generators, battery energy storage systems (Storage), and wind generators.
- Analyzes thermal line loading limits and voltage regulation limits (ANSI C84.1 Range A:
): - Identifies reverse power flow hazards where generation exceeds local demand, pushing power back through substation transformers into the transmission bulk grid (
@modelscript/psse).
3. Direct DAE Lowering
- Compiles lines, transformers, and voltage-dependent loads into
@modelscript/runtime'sDAEBuilderlinear memory arena. - Enables co-simulation between distribution feeders, electromagnetic transients in inverter controllers (
@modelscript/pscad), and building thermal energy consumption (@modelscript/energyplus).
4. Bidirectional Modelica 3.x Projection
- Projects OpenDSS circuits into standard multi-phase Modelica or OpenIPSL electrical network models with acausal electrical pins (
v,i).
Pre-Flight Diagnostics
The OpenDSS linter verifies electrical connectivity and DER operating envelopes:
10 rules7 error3 warning Run with msx opendss lint
| Code | Rule | Severity | Message |
|---|---|---|---|
M8401 | unconnected-bus-node | error | <elemType> '<elemName>' references undefined bus node '<busName>'. |
M8402 | phase-count-mismatch | error | Element '<elemName>' (<elemPhases> phases) connected to bus '<busName>' with different phase count (<busPhases>). |
M8402 | transformer-impedance-zero | error | Transformer '<xfmrName>' specifies non-positive leakage reactance (xhl=<xhl>); must be > 0. |
M8403 | load-pf-out-of-range | warning | Load '<loadName>' specifies power factor (<pf>) outside valid range (0 < |pf| <= 1.0). |
M8403 | transformer-voltage-mismatch | warning | Transformer '<xfmrName>' winding <winding> rated voltage (<value> kV) differs from nominal bus voltage (<value> kV). |
M8404 | reverse-power-hosting-risk | warning | Total DER generation capacity on feeder '<feederName>' (<value> kW) exceeds upstream transformer thermal rating (<value> kVA). |
M8405 | missing-circuit-definition | error | OpenDSS script defines circuit elements without declaring a 'New Circuit' voltage source. |
M8406 | negative-load-power | error | Load '<loadName>' specifies negative active power (<value> kW); use Generator or Storage for net generation. |
M8407 | zero-or-negative-line-length | error | Line '<lineName>' specifies invalid non-positive length (<len>). |
M8408 | missing-line-code | error | Line '<lineName>' references undefined LineCode '<codeName>'. |
Generated from languages/opendss/src/errors.ts. All languages →
CLI Usage
bash
# Inspect distribution buses, lines, transformers, and DER units
msx opendss inspect IEEE13NodeFeeder.dss
# Run pre-flight linting and connectivity verification
msx opendss lint IEEE13NodeFeeder.dss
# Solve multi-phase AC power flow and print bus voltages
msx opendss powerflow IEEE13NodeFeeder.dss
# Lower circuit into ModelScript linear DAE arena
msx opendss to-dae IEEE13NodeFeeder.dss
# Project into Modelica 3.x electrical power model
msx opendss to-modelica IEEE13NodeFeeder.dss -o DistributionFeeder.mo
