PSS/E Transmission Power Flow (.raw)
The @modelscript/psse language package (languages/psse) provides native support for Siemens PSS®E RAW (.raw) transmission grid power flow base cases (Revisions 30 through 35). It delivers streaming parsing, round-trip serialization, pre-flight topological linting (P1001–P4001), sparse nodal admittance matrix (
Supported File Specifications
| Revision | Specification | Key Structural Features |
|---|---|---|
| PSS/E-30 | Legacy Planning Deck | 6-character bus names, integer area/zone codes, fixed branch thermal rating blocks |
| PSS/E-32 | Extended Format | 12-character alphanumeric bus names, expanded DC line modeling, switched shunt blocks |
| PSS/E-33 | Modern Standard | Canonical 12-character names, multi-section lines, 2-terminal & VSC DC transmission, GIC records |
| PSS/E-34 | Substation-Oriented | Node-breaker topologies, explicit substation IDs, multi-terminal DC grids |
| PSS/E-35 | High-Density Matrix | Extended branch identifiers, expanded transformer winding data, flexible rating vectors |
Architecture & Compilation Pipeline
1. Pre-Flight Electrical Diagnostic Rules
@modelscript/psse runs pre-flight static checks across electrical topology, connection consistency, and equipment parameter bounds before simulation or projection:
13 rules6 error7 warning Run with msx psse lint
| Code | Rule | Severity | Message |
|---|---|---|---|
P1001 | bus-not-found | error | <entityKind> '<id>' references non-existent <busRole>bus <busId>. |
P1002 | generator-negative-power | warning | Generator '<genId>' at bus <busId> has negative active power output (<pg> MW). |
P1003 | duplicate-equipment-id | error | Duplicate generator ID '<genId>' at bus <busId>. |
P2001 | isolated-bus | warning | Bus <busId> ('<busName>') is isolated with 0 in-service connecting branches or transformers. |
P2002 | missing-slack-bus | error | Power network base case contains 0 slack/swing buses (Bus Type 3). Power flow solution cannot be anchored. |
P2003 | multiple-slack-buses | warning | Power network base case contains <count> swing buses without explicit multi-island partitioning. |
P2004 | voltage-out-of-bounds | warning | Initial voltage magnitude at bus <busId> (<value> pu) is outside standard operational limits [0.8, 1.2 pu]. |
P3001 | generator-reactive-limits-inverted | error | Generator '<genId>' at bus <busId> has inverted reactive limits: Qmin (<qMin> MVAR) > Qmax (<qMax> MVAR). |
P3002 | generator-power-limits-inverted | error | Generator '<genId>' at bus <busId> has inverted active power limits: Pmin (<pMin> MW) > Pmax (<pMax> MW). |
P3003 | generator-scheduled-voltage-bounds | warning | Generator '<genId>' scheduled voltage Vs = <vs> p.u. is outside the typical operating band [0.8, 1.2]. |
P4001 | branch-invalid-reactance | error | Transmission branch '<ckt>' between bus <fromBus> and <toBus> has zero or negative reactance X = <x> p.u. |
P4002 | branch-base-kv-mismatch | warning | Branch '<ckt>' connects bus <fromBus> (<fromKv> kV) to bus <toBus> (<toKv> kV) without a transformer. |
P4003 | transformer-tap-out-of-bounds | warning | Transformer '<ckt>' between bus <fromBus> and <toBus> has off-nominal tap ratio <ratio> outside typical limits [0.7, 1.3]. |
Generated from languages/psse/src/errors.ts. All languages →
2. Sparse Nodal Admittance Matrix ( )
The network admittance matrix extractPowerFlowNetlist() in languages/psse/src/netlist/powerflow-netlist.ts:
Transmission Lines ( -Equivalent)
For a branch connecting buses
Transformers with Complex Tap Ratio
For a transformer with off-nominal turns ratio magnitude
3. In-Engine Non-Linear AC Power Flow Solver
@modelscript/psse includes an exact, non-linear AC Power Flow engine (solvePowerFlow() in languages/psse/src/solver/ac-powerflow.ts) supporting both Newton-Raphson and Fast Decoupled Power Flow (FDPF):
Mismatch Formulation
For each bus
where
Analytical Jacobian & Adaptive Damping
The linearized Newton system at each iteration
( ), and . ( ), and . ( ), and . ( ), and .
Generator -Limit Clamping & PV-to-PQ Switching
When
4. Multi-Domain Interoperability Projections
Projection to Modelica (psseToModelica)
Projects a .raw case into a clean, strongly-typed Modelica physical system model:
- Buses mapped to equipotential AC pins.
- Generators mapped to sinusoidal voltage sources (
Modelica.Electrical.Analog.Sources.SineVoltage). - Branches mapped to series R-L models (
Modelica.Electrical.Analog.Basic.Resistor+Inductor). - Loads mapped to constant active and reactive impedance networks.
model Ieee14Test
Modelica.Electrical.Analog.Basic.Ground ground;
Modelica.Electrical.Analog.Sources.SineVoltage gen_1_1(V = 106.0, f = 60.0);
Modelica.Electrical.Analog.Basic.Resistor line_1_2_r(R = 0.01938);
Modelica.Electrical.Analog.Basic.Inductor line_1_2_l(L = 0.0001569);
equation
connect(gen_1_1.n, ground.p);
connect(gen_1_1.p, line_1_2_r.p);
connect(line_1_2_r.n, line_1_2_l.p);
end Ieee14Test;Projection to PSCAD / EMT Netlist (psseToEmtNetlist)
Generates multi-bus companion-circuit netlists compatible with ModelScript's Dommel EMT solver (@modelscript/simulate) for transient stability and electromagnetic switching studies.
5. Command-Line Interface (msx psse)
ModelScript's CLI provides headless inspection, linting, diagram rendering, and power flow solving:
# Display summary of buses, generators, loads, branches, and MW totals
msx psse summary case.raw
# Run pre-flight electrical topology and bounds linter
msx psse lint case.raw
# Solve non-linear AC power flow with Newton-Raphson (default)
msx psse solve case.raw
# Solve with Fast Decoupled algorithm and custom tolerance
msx psse solve case.raw --algorithm=fdpf --tol=1e-5 --max-iter=30
# Export publication-quality Single-Line Diagram SVG
msx psse diagram case.raw --out=grid.svg
# Inspect sparse Ybus non-zero entry metrics
msx psse netlist case.raw6. Custom Visual Webview Editor (modelscript.rawEditor)
Opening any .raw file in the ModelScript IDE or VS Code launches the custom dual-mode editor:
- Single-Line Diagram View: Interactive pan/zoom SVG canvas with voltage-tier color coding (345 kV red, 138 kV blue, 69 kV green), power flow overlays, and generator/transformer glyphs.
- High-Density Tabular Grid: Live-filterable tables for Buses, Generators, Branches, Transformers, and Loads with search.
- Overload & Violation Badges: Automatic highlight of under-voltage (
), over-voltage ( ), and thermal line overloads ( ). - Export Toolbar: Export to SVG diagrams, Modelica
.mopackages, and PSCAD/EMT netlists.

