> 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/rt-lab/model-and-simulation/phasor-domain-with-ephasorsim/configure-power-flow.md).

# Configure Power Flow

## Introduction

Power flow analysis computes the steady-state operating point of a power system by solving for bus voltage magnitudes, voltage angles, and generator reactive power outputs while satisfying the network power balance. In ePHASORSIM, the solution assumes that transformer tap positions and switchable shunt devices remain fixed during the calculation.

Power flow is supported for:

* **Positive-sequence networks**, including machine models.
* **Multiphase networks**, including voltage source models.

Multiphase power flow is available only for networks built using the **Excel Template** or imported from **CYME**.

Power-flow calculations are executed **offline on the workstation** and do not impact real-time simulation performance. The computed results can then be used to initialize a dynamic simulation. ePHASORSIM uses the **Newton-Raphson** algorithm and automatically retrieves the system base power (MVA) from the network data. Convergence settings such as tolerance and maximum iterations are configurable.

{% hint style="danger" %}
Power-flow calcultations in ePHASORSIM require the **EPHASOR\_FEATURE\_POWERFLOW** license feature on the workstation.
{% endhint %}

## Supported components

### Positive-sequence networks

### Multiphase networks

## Island detection

Power-flow calculations cannot be performed when unenergized islands are present in the network. When islands are detected, ePHASORSIM generates a `[network_name]_islands.csv` file which lists the buses belonging to each island. This file is saved in the `[xlsx file name].PowerFlow` folder within the model directory.

To successfully run a power flow, each energized island must contain **exactly one Slack bus**.

## Run a power flow

{% stepper %}
{% step %}

### Configure the power flow parameters

In the **Simulation settings** tab of the **ePHASORSIM Solver** block, under **Power-flow calculation**, configure the following parameters:

* **Initialization method.** Select the initialization method used to generate the initial guess for the Newton-Raphson solver:
  * **From Input Data**: Uses the voltage magnitudes and voltage angles specified in the network input data.
  * **Flat Start**: Initializes all PQ bus voltages to **1.0 pu** and all bus voltage angles to **0°**.
  * **Smart Start**: Solves a linear approximation of the power-flow equations to generate an improved initial guess before running the Newton-Raphson solver.

{% hint style="info" %}
Use **Smart Start** for large or difficult-to-converge networks. For most studies, **From Input Data** is sufficient when reliable initialization values are available.
{% endhint %}

* **Power mismatch (max p.u.)**: Defines the convergence tolerance of the power-flow solution (default: **1e-8**). The algorithm terminates when the norm of the mismatch equations falls below the specified tolerance.
* **Max number of NR Iterations**: Defines the maximum number of Newton-Raphson iterations allowed before the solution is considered unsuccessful (default: **100**).

  If convergence is not achieved within the specified limit, the calculation stops and ePHASORSIM displays *Power-flow didn't converge*.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-0a1ff94b5547e63b1480eed2fc145c2007b0303c%2Feph-rtlab-powerflow.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Execute the power flow

Run the power-flow calculation using one of the following actions:

* **Execute**
* **Execute and export report**

The solver computes the network steady-state operating point and verifies convergence.
{% endstep %}

{% step %}

### Review the results (optional)

After a successful power-flow calculation, ePHASORSIM generates the following files:

* The `[xlsx file name]_solver_powerflow.opal` file, which contains the network solution updated with the calculated bus voltages, bus angles and machine reactive power outputs. This file is created only when the power flow converges successfully.
* The `[xlsx file name]_powerflow.state file`, which stores internal power-flow state information between executions. This file is managed by ePHASORSIM and should not be modified manually.

When the power-flow calculation is executed using **Execute and Export Report**, ePHASORSIM also exports the results to an Excel workbook, saved in the `[xlsx file name].PowerFlow` folder within the model directory.

The report may contain the following sheets:

* **Network Composition**: Summary of the buses and components detected in the network.
* **Bus**: Bus type (`Slack`, `PV`, `PQ`), base voltage, and calculated voltage magnitude and angle.
* **Machine**: Machine operating point, including active and reactive power output and reactive power limits.
* **Load**: Calculated active and reactive power consumption after the power-flow solution. For voltage-dependent loads, the reported values may differ from the specified parameters.
* **Statistics**: Convergence information, including the number of iterations and the maximum power mismatch.

If a generator connected to a **PV bus** exceeds its reactive power limits (`Qmin` or `Qmax`), ePHASORSIM clamps the reactive power to the corresponding limit and automatically converts the bus to a **PQ bus**. Such buses are identified as `PV` in the Bus report.
{% endstep %}

{% step %}

### Initialize the Dynamic simulation (optional)

To automatically initialize a dynamic simulation from the calculated steady-state operating point, enable **Start from Power Flow**. Click **Apply** to save the configuration.

When enabled, ePHASORSIM runs a power-flow calculation at the start of the simulation and uses the resulting bus voltages, machine operating points, and controller states to initialize the network. This ensures that the dynamic simulation begins from a consistent steady-state condition.
{% endstep %}

{% step %}

### Configure the solver settings

With power flow now configuration complete, continue to [Set Phasor Settings & Run Simulation](https://www.opal-rt.com/docs/rt-lab/model-and-simulation/phasor-domain-with-ephasorsim/set-phasor-settings-run-simulation.md) to configure the ePHASORSIM solver, including the phasor time step and parallel execution settings.
{% endstep %}
{% endstepper %}


---

# 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/rt-lab/model-and-simulation/phasor-domain-with-ephasorsim/configure-power-flow.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.
