> For the complete documentation index, see [llms.txt](https://www.opal-rt.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.opal-rt.com/docs/hypersim/model-and-simulation/prepare-the-simulation/run-load-flow-analysis.md).

# Run Load Flow Analysis

## Overview

**Load flow analysis** allows HYPERSIM to initialize a power system model from a **steady-state operating point** instead of starting all electrical quantities at zero. It computes bus voltages, voltage angles, currents, and active/reactive power flows for a given operating condition.

This is especially useful before simulation start, because the resulting values can be used as **initial conditions** for buses and supported components.

In load flow analysis, each bus is described by four variables:

* **P**: active power
* **Q**: reactive power
* **V**: voltage magnitude
* **θ**: voltage angle

Since the power flow equations provide two equations per bus, **at least two of these four variables must be known** at each bus so the others can be solved.

For background on load flow studies, see [**IEEE Std 3002.2™-2018**](https://mentor.ieee.org/3000-stds/dcn/19/stds-19-0002-00-PUBS-3002-2.pdf).

## Load flow theory

The network is represented by its **bus admittance matrix** ***Y***, built from the single-line equivalent of the system:

* The diagonal elements ***Y***<sub>***ii***</sub>​ are the sum of admittances connected to bus ***i***.
* The off-diagonal elements ***Y***<sub>***ij***</sub><sub>​</sub> are the negative sum of admittances connected between buses ***i*** and ***j***.

Using this matrix, HYPERSIM writes the nodal equation:

$$
I = YV
$$

where:

* ***I*** is the vector of source currents injected into each bus
* ***V*** is the vector of bus voltages

For each bus, the complex power is:

$$
\overline{S\_i} = P\_i + jQ\_i = \overline{V\_i} \times \overline{I\_i}^{,\*}
$$

Where ***P*** is active power and ***Q*** is reactive power.

$$
\overline{V\_i} = V\_i e^{j\theta\_i}
\\\[8pt]
\overline{V\_j} = V\_j e^{j\theta\_j}
\\\[8pt]
\overline{Y\_{ij}} = Y\_{ij} e^{j\alpha\_{ij}}
\\\[8pt]
\overline{S\_i} = P\_i + jQ\_i =
V\_i e^{j\theta\_i}
\left\[
\sum\_{j=1}^{n} Y\_{ij} V\_j e^{j(\theta\_j + \alpha\_{ij})}
\right]^\*
$$

Where

* ***V***<sub>***i***</sub> and ***V***<sub>***j***</sub> are the bus voltage magnitude at bus ***i*** and ***j***
* ***θ***<sub>***i***</sub> and ***θ***<sub>***j***</sub> are the bus angles at bus ***i*** and ***j***
* ***Y***<sub>***ij***</sub> is the value of the admittance between bus ***i*** and ***j***
* ***α***<sub>***ij***</sub> is the angle of the admittance between bus ***i*** and ***j***

From these equations, HYPERSIM solves the unknown voltage magnitudes and phase angles across the network.

This leads to the following expressions for active and reactive power:

$$
P\_i = \sum\_{j=1}^{n} V\_i V\_j Y\_{ij} \cos(\theta\_i - \theta\_j - \alpha\_{ij})
\\\[8pt]
Q\_i = \sum\_{j=1}^{n} V\_i V\_j Y\_{ij} \sin(\theta\_i - \theta\_j - \alpha\_{ij})
$$

For each node ***i***, four variables are involved in the load flow equations: ***P***<sub>***i***</sub>, ***Q***<sub>***i***</sub>, ***V***<sub>***i***</sub> and ***θ***<sub>***i***</sub>.

Since only two equations are available per bus, the user must **define two variables**, while the other two are solved by the load flow algorithm.

### Bus types

Buses are categorized based on which variables are specified:

<details>

<summary><strong>Swing bus (Slack bus)</strong></summary>

* Known: **V**, **θ\thetaθ**
* Solved: **P**, **Q**

There must be **exactly one swing bus** in the network. It must be a source (e.g., voltage source or generator).

The swing bus provides the reference angle for the entire system and compensates for power mismatches between generation and load.

</details>

<details>

<summary><strong>PV bus (Generator bus)</strong></summary>

* Known: **P**, **V**
* Solved: **Q**, **θ\thetaθ**

The user defines the **active power** and **voltage magnitude**. This type is typically used for generators where voltage and real power are controlled.

</details>

<details>

<summary><strong>PQ bus (Load bus)</strong></summary>

* Known: **P**, **Q**
* Solved: **V**, **θ\thetaθ**

The user defines **active** and **reactive power**. This type is commonly used for loads with fixed power consumption. PQ mode can also be used for generators if needed

</details>

## Solver and convergence

HYPERSIM uses the **Newton–Raphson iterative method** to solve the load-flow problem.

The **Tolerance** parameter controls the convergence criterion. Lower tolerance values generally improve the accuracy of the solution but may increase the number of iterations required and, in some cases, prevent convergence within the specified maximum number of iterations.

Load-flow initialization is intended to place the system close to its steady-state operating point prior to the start of the simulation. Nevertheless, small transient responses may still occur during the initial moments of the simulation before the system settles.

These transients are expected and can arise from several modeling limitations:

* Some components are not included in the load-flow calculation.
* The load-flow solution is based on a **linearized representation** of the system.
* Nonlinear phenomena, such as **transformer saturation**, **machine saturation**, and **surge arrester characteristics**, are not fully represented.
* The load-flow calculation assumes:
  * **Balanced operating conditions** (positive-sequence network only).
  * **Nominal system frequency**.

As a result, the simulated system may settle at an operating point that differs slightly from the one obtained during load-flow initialization.

## Limitations <a href="#limitations" id="limitations"></a>

* **Unbalanced load flow analysis is currently not supported.**
* **Load-flow initialization from external data sources** (e.g., PSS®E, PowerFactory, and similar tools) **is currently available only through Python scripting.**
* **The following components are not yet supported:**
  * Current Transformer (CT)
  * Arc Furnace
  * Harmonic Load
  * Static Var Compensator (SVC)
  * Line-Commutated Converter (LCC) converters


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.opal-rt.com/docs/hypersim/model-and-simulation/prepare-the-simulation/run-load-flow-analysis.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
