Skip to content

Power Flow (Helios)

Helios is the STEPSS AC power-flow engine. It solves the Newton-Raphson power flow in polar coordinates with reactive limit enforcement, transformer tap adjustment and SVC modelling, and it produces the operating point that initialises a RAMSES dynamic simulation.

Helios is available three ways, all reading the same data files:

The power flow uses the following network records documented in Network Modeling: BUS, LINE, SWITCH, TRANSFO, TRFO, NRTP.

The additional records specific to power flow computations are documented below.

Load and shunt data are specified in an extended version of the BUS record:

BUS NAME VNOM PLOAD QLOAD BSHUNT QSHUNT ;
FieldDescriptionUnit
NAMEBus name (max 8 characters)
VNOMNominal voltagekV
PLOADTotal active power load (positive = consumed)MW
QLOADTotal reactive power load (positive = consumed)Mvar
BSHUNTNominal reactive power of constant-susceptance shunt: the reactive power produced under the nominal voltage of the bus (positive = capacitor, negative = reactor)Mvar
QSHUNTReactive power of constant-power shunt (positive = capacitor)Mvar

If no load is connected to the bus, set PLOAD and QLOAD to zero. If no shunt is connected, set BSHUNT and QSHUNT to zero. QSHUNT is optional: a five-field BUS record is accepted and QSHUNT defaults to zero.

The total reactive power QQ produced by both shunt components:

Q=BSHUNT(VVnom)2+QSHUNTQ = \text{BSHUNT} \cdot \left(\frac{V}{V_{nom}}\right)^2 + \text{QSHUNT}
GENER NAME BUS P Q VIMP SNOM QMIN QMAX BR ;
FieldDescriptionUnit
NAMEGenerator name (max 20 characters)
BUSConnection bus name
PActive power producedMW
QReactive power produced (ignored if VIMP ≠ 0)Mvar
VIMPImposed voltage (0 = PQ bus, nonzero = PV bus)pu
SNOMNominal apparent powerMVA
QMINLower reactive power limitMvar
QMAXUpper reactive power limitMvar
BRBreaker status (0 = open)

For PV buses, if the upper reactive power limit QMAX is exceeded, the bus switches to PQ type with QMAX enforced, and Newton iterations continue. If subsequently the bus voltage rises above VIMP, the bus switches back to PV type. Similarly, if QMIN is exceeded, the bus switches to PQ type with QMIN enforced; it switches back to PV if the voltage subsequently drops below VIMP.

QMIN and QMAX are used only if VIMP is nonzero (PV bus).

An extended variant with active power limits and a participation factor exists:

GENER NAME BUS P Q VIMP SNOM QMIN QMAX PMIN PMAX PART BR ;
FieldDescriptionUnit
PMINMinimum active power the generator can produceMW
PMAXMaximum active power the generator can produceMW
PARTParticipation factor used when redistributing an active power imbalance

PMIN/PMAX are not enforced during Newton iterations. They are used to clamp the specified P before the computation (the slack generator is exempted by default; see $PLIM below), and together with PART when generation is redispatched after system modifications or contingencies.

Both variants also accept an additional bus-name field between BUS and P (making 10 or 13 fields in total); that field is accepted and ignored.

Only one generator is allowed per bus.

All generators are memorized, even those which are disconnected. A disconnected generator has zero power output but can be put into service during dynamic simulation.

A slack bus is mandatory for power flow computations: not all buses can be of PV or PQ type, since this would require knowing the active power losses in the network before performing the calculation.

A PV-type generator must be connected to the slack bus. Its voltage magnitude (from the GENER record) is imposed, and the voltage phase angle is set to zero.

SLACK NAME ;
FieldDescription
NAMEBus name (max 8 characters)

There must be exactly one SLACK record in the data.

Only one connected network (island) is solved. If the graph is disconnected, only the sub-network containing the slack bus is treated; equipment on the discarded buses is disabled and the lost active power is reported so that it can be redispatched.

Although reference is made to an SVC, the model can be used in general for any component controlling voltage with a droop. The SVC is assumed lossless: the active current injected at the controlled bus is zero.

The SVC is modeled with a controllable susceptance BB at a controlled bus ii, regulating the voltage at a monitored bus jj:

SVC model IQi=G(VjoVj)Vi(voltage control)I_{Qi} = G(V_j^o - V_j) V_i \quad \text{(voltage control)} IQi=BmaxVi(upper limit)IQi=BminVi(lower limit)I_{Qi} = B_{max} V_i \quad \text{(upper limit)} \quad\quad I_{Qi} = B_{min} V_i \quad \text{(lower limit)}
SVC NAME CON_BUS MON_BUS V0 Q0 SNOM BMAX BMIN G BR ;
FieldDescriptionUnit
NAMESVC name (max 20 characters)
CON_BUSControlled bus where the susceptance BB is varied (max 8 characters)
MON_BUSMonitored bus whose voltage is regulated (max 8 characters)
V0Voltage setpoint VjoV_j^o (0 = constant power mode with P=0P=0, Q=Q0Q=Q0, no limits tested)pu
Q0Reactive power setpoint (ignored if V0 ≠ 0)Mvar
SNOMNominal reactive powerMvar
BMAXMaximal nominal reactive power: reactive power produced under Vi=1V_i = 1 pu when B=BmaxB = B_{max}Mvar
BMINMinimal nominal reactive power: reactive power produced under Vi=1V_i = 1 pu when B=BminB = B_{min}Mvar
GGain, in pu on the (VBV_B, SNOM) base, where VBV_B is the nominal voltage at the controlled buspu
BRBreaker status (0 = open, other = closed)

It is common for BMAX to be positive and BMIN negative, but other combinations are allowed.

For SVCs with nonzero V0, the voltage control equation is solved initially. If the susceptance upper limit BMAX is exceeded, the limit is enforced and Newton iterations continue. The SVC reverts to voltage control when G(VjoVj)<BmaxG(V_j^o - V_j) < B_{max}. Similarly, if BMIN is exceeded, the lower limit is enforced; the SVC reverts when G(VjoVj)>BminG(V_j^o - V_j) > B_{min}.

Only one SVC is allowed per bus. It is not allowed to connect both a generator and an SVC to the same bus.

All SVCs are memorized, even those which are disconnected. A disconnected SVC can be put into service during dynamic simulation.

Transformer Ratio Adjustment for Voltage Control

Section titled “Transformer Ratio Adjustment for Voltage Control”

The ratio of a designated transformer can be adjusted to bring a controlled voltage inside a deadband [Vdesϵ,  Vdes+ϵ][V_{des} - \epsilon,\; V_{des} + \epsilon], where VdesV_{des} is the desired voltage and ϵ\epsilon is the tolerance.

The ratio is changed in discrete steps between a minimum and maximum value. During computation, the ratio is changed by one step at a time, after which Newton iterations run until convergence. The process repeats until the controlled voltage falls in the deadband. When multiple transformers are adjusted, some may reach their deadbands before others.

The controlled bus is CONBUS in the TRFO record. This must be one of the two ending buses of the transformer. An empty or blank string enclosed within quotes indicates that the transformer ratio is not to be adjusted; in this case, dummy values must still be provided for the remaining fields.

The ratio corresponding to tap position pp (1pNBPOS1 \le p \le \text{NBPOS}):

n=NFIRST100+p1NBPOS1NLASTNFIRST100n = \frac{\text{NFIRST}}{100} + \frac{p-1}{\text{NBPOS}-1} \cdot \frac{\text{NLAST} - \text{NFIRST}}{100}

The initial ratio from the N field of the TRFO record is adjusted to the nearest tap position before starting the power flow computation.

Relevant fields in the TRFO record:

FieldDescriptionUnit
NFIRSTRatio at first tap position (lower bound)%
NLASTRatio at last tap position (upper bound)%
NBPOSTotal number of tap positions (including first and last)
TOLVVoltage tolerance ϵ\epsilonpu
VDESDesired voltage VdesV_{des}pu

The second way to specify ratio adjustment is through a separate LTC-V record. This is more natural in association with a TRANSFO record.

LTC-V NAME CON_BUS NFIRST NLAST NBPOS TOLV VDES ;
FieldDescriptionUnit
NAMEName of the controlled transformer (max 20 characters)
CON_BUSControlled bus (max 8 characters)
NFIRSTRatio at first tap position (lower bound)%
NLASTRatio at last tap position (upper bound)%
NBPOSTotal number of tap positions (including first and last)
TOLVVoltage tolerance ϵ\epsilonpu
VDESDesired voltage VdesV_{des}pu

A transformer can be controlled by a single tap changer only. The LTC-V record can also be associated with a TRFO record, provided that no adjustment is specified in the TRFO record itself.

Only this seven-field linear-ratio form is supported; there is no per-tap reactance variant.

Phase-Shifting Transformer Adjustment (PSHIFT-P)

Section titled “Phase-Shifting Transformer Adjustment (PSHIFT-P)”

The phase angle of a transformer can be adjusted to bring the active power flow in a monitored branch inside a deadband [Pdesϵ,  Pdes+ϵ][P_{des} - \epsilon,\; P_{des} + \epsilon]. The adjustment mechanism is similar to the in-phase ratio adjustment described above.

PSHIFT-P CONTRFO MONBRANCH PHAFIRST PHALAST NBPOS SIGN PDES TOLP ;
FieldDescriptionUnit
CONTRFOName of the transformer whose phase angle is adjusted (max 20 characters, defined in a TRFO or TRANSFO record). If the transformer does not exist, the record is ignored with a warning
MONBRANCHName of the branch where active power PP is monitored (max 20 characters, defined in a LINE, TRFO, or TRANSFO record). PP is the active power leaving the first bus of the branch record
PHAFIRSTPhase angle ϕ\phi at first tap position (lower bound)degrees
PHALASTPhase angle ϕ\phi at last tap position (upper bound)degrees
NBPOSNumber of tap positions
SIGNDirection indicator: 1 means ϕ\phi must increase to increase power flow; -1 means decrease. Any other value causes the program to stop
PDESDesired active power flowMW
TOLPTolerance ϵ\epsilonMW

The phase angle ϕ\phi at tap position pp (1pNBPOS1 \le p \le \text{NBPOS}) is:

ϕ=PHAFIRST+p1NBPOS1(PHALASTPHAFIRST)\phi = \text{PHAFIRST} + \frac{p-1}{\text{NBPOS}-1}(\text{PHALAST} - \text{PHAFIRST})

The initial phase angle from the PHI field of the TRANSFO record is adjusted to the nearest tap position before starting the power flow computation.

A sensitivity analysis determines whether the phase angle should be increased or decreased. If this analysis indicates a direction opposite to SIGN, a warning is issued and SIGN is ignored. On output, SIGN is set to the value from the sensitivity analysis.

Only one PSHIFT-P record per transformer is allowed. The PSHIFT-P record is intended for use with a TRANSFO record, but can also be used with a TRFO record (in which case the angle is initialized to zero).

A transformer cannot be controlled by both an LTC-V and a PSHIFT-P record.

A detailed form with per-tap data (10 + 4k fields) is also accepted.

Two optional records group equipment for reporting. They do not affect the solution.

BUSPART ZONE_NAME BUS_NAME PARTP PARTQ ;
FieldDescription
ZONE_NAMEZone name; the zone is created on first use
BUS_NAMEBus to include in the zone (max 8 characters)
PARTPActive power participation weight of this bus in the zone
PARTQReactive power participation weight of this bus in the zone

Zones drive the zone-power display and the zone-wide load and generation changes of the modify menu. Buses with unrecognised names are skipped.

BRAPART CUT_NAME BRANCH_NAME BUS_NAME SIGN ;
FieldDescription
CUT_NAMECut name; the cut is created on first use
BRANCH_NAMEBranch to include in the cut (max 20 characters)
BUS_NAMEOne endpoint of the branch, fixing the direction of the flow that is summed
SIGN+1 or -1, applied to that branch’s contribution

The cut power is the signed sum of the member branch flows, reported per branch and as a total.

Bus Voltages: Initial Values and Results (LFRESV)

Section titled “Bus Voltages: Initial Values and Results (LFRESV)”

On output, the power flow produces a file with the computed bus voltage magnitudes and phase angles. These are stored in LFRESV records. The syntax is:

LFRESV BUS MODV PHASV ;
FieldDescriptionUnit
BUSBus name (max 8 characters)
MODVVoltage magnitudepu
PHASVVoltage phase angle, referenced to slack busradians

After loading data and solving, Helios presents these commands:

CommandDescription
PTake new control parameters from file
DDisplay output values
1Display outputs on 1-line diagram (SVG)
MModify system (change loads, generators, topology)
RIReset system to initial configuration
CAPerform contingency analysis
CLCheck operating limits (voltage bounds, branch overloads)
OChange output file
DFUpdate all records and dump them to a file
VTGenerate a file with voltages and adjustable transformer ratios (LFRESV format)
SSave operating point and Y matrix to MATLAB file
EExit

The VT command produces the LFRESV file needed to initialize RAMSES.

The power flow uses Newton-Raphson iterations to solve the power flow equations. Convergence is achieved when both the active and reactive power mismatches fall below specified thresholds, all transformer ratio and phase-shift controls are satisfied, and all generators and SVCs are within their reactive limits.

Three convergence indices are used:

  • ϵP\epsilon_P: largest absolute mismatch of the active power equations
  • ϵQ\epsilon_Q: largest absolute mismatch of the reactive power equations
  • ϵS\epsilon_S: largest apparent power mismatch, used to trigger limit checks (via $MISQLIM), factorization reuse (via $MISBLOC), and transformer adjustments (via $MISADJ)

The following records control the computation. Each record starts with $ and has a single numeric field; a known $ record with any other field count is a hard error, and an unknown $ key is ignored.

ParameterDefaultUnitDescription
$SBASE100MVASystem base power (on which pu values are expressed)
$TOLAC0.1MWConvergence tolerance on active power mismatch (ϵP\epsilon_P)
$TOLREAC0.1MvarConvergence tolerance on reactive power mismatch (ϵQ\epsilon_Q)
$NBITMA20Maximum number of Newton iterations
$MISQLIM20MVAApparent power mismatch threshold below which generator/SVC reactive limits are checked and enforced (set to 0 to skip)
$MISBLOC10MVAApparent power mismatch threshold below which the Jacobian factorization reuses the previous pivot ordering. Jacobian values are recomputed at every iteration regardless
$MISADJ10MVAApparent power mismatch threshold below which transformer ratios and phase shifts are adjusted (set to 0 to skip)
$DIVDET0Set to 1 to activate divergence detection; 0 to skip
$PLIM11 = the slack generator’s PMIN/PMAX are bypassed during initial P clamping; 0 = the slack is clamped like any other generator

$PLIM only affects 12/13-field GENER records, the only ones that carry real active power limits.

In non-interactive use (-t command file mode and pipe mode), Helios reports the outcome of the run through its process exit status:

ExitMeaning
0Converged, the results are usable
1Input or usage error: bad command file, unreadable data file, parse failure, unknown command
2The solve ran but did not converge: maximum iterations, divergence, or a singular Jacobian. Results may still have been written, but they are not a valid power-flow solution

Only 0 means the results can be trusted. Where a command file modifies the system and re-solves, the status reflects the final solve. The interactive TUI always exits 0.

Each non-interactive run also writes one machine-readable line to stderr:

helios: status: CONVERGED (2 iterations)
helios: status: NOT_CONVERGED (max iterations)
helios: status: NOT_CONVERGED (diverged)
helios: status: NOT_CONVERGED (singular)
helios: status: NOT_RUN

NOT_RUN means no solve was requested (for example $NBITMA 0), which exits 0. Scripts should use the exit status and this line rather than parsing stdout.

These values are shared with the Helios C API, where HELIOS_OK is 0 and HELIOS_NOT_CONVERGED is 2 (1 is reserved and never returned by the API). HELIOS_NOT_CONVERGED is 2 from Helios 1.4.1 onward; in 1.3.0 and earlier it was 1. The stepss.helios.HeliosSession wrapper exposes convergence as the boolean pf.converged and the pf.solver_status enum, neither of which is affected by the numbering.

Record Sharing Between Power Flow and RAMSES

Section titled “Record Sharing Between Power Flow and RAMSES”

The following table summarises which records are used by the power flow and by RAMSES respectively.

RecordPower flowRAMSES
BUSAll 6 fields (QSHUNT optional)First 2 fields (NAME, VNOM)
LINEAll fieldsAll fields
SWITCHAll fieldsAll fields
NRTPAll fieldsAll fields
TRANSFOAll fieldsAll fields
TRFOAll fieldsFields 1 to 9 and 15 only
SHUNTIgnoredAll fields
GENERAll fieldsIgnored
SVCAll fieldsIgnored
SLACKUsedUsed
LFRESVInput: initial values; Output: solutionInput: initial values for RAMSES
LTC-VUsedIgnored
PSHIFT-PUsedIgnored
BUSPART, BRAPARTUsed for reportingIgnored

Helios succeeds PFC, the Fortran power-flow calculator written by Dr. Thierry Van Cutsem that was the STEPSS power flow from the beginning. Helios reimplements its Newton-Raphson formulation in C++20, reads the same input files, and matches its solver defaults, so data prepared for PFC runs unchanged. PFC is no longer shipped with STEPSS or with stepss; nothing on this page requires it.

Two numerical points are worth knowing when comparing old results with new ones:

  • The two engines use different sparse linear solvers, so the last displayed decimal can differ.
  • Helios recomputes the Jacobian values at every iteration, a true Newton method, where PFC froze them below $MISBLOC. Iteration counts can therefore differ slightly.