> 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/simulink-blocks-reference/rt-lab-library/ephasorsim-solver.md).

# ePHASORSIM Solver

## Description

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-70f647ffec7feb25e4743ebfa196d0d829f4b244%2Fephasorsim-solver-block.png?alt=media" alt=""><figcaption></figcaption></figure>

The **ePHASORSIM Solver** block, located in the **RT-LAB/ePHASORSIM** library, executes phasor-domain simulations of large-scale power systems. It supports models imported from **PSS®E**, **PowerFactory**, and **CYME**, as well as models built using the **ePHASORSIM Native Library**, while interfacing the power-system simulation with the surrounding Simulink environment.

For detailed information about ePHASORSIM concepts, workflows, and configuration options, refer to the [Phasor-Domain with ePHASORSIM](https://www.opal-rt.com/docs/rt-lab/model-and-simulation/phasor-domain-with-ephasorsim.md) documentation.

## Mask parameters

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-e0876d3983eea3ea94d475030da34718e3edd437%2Fephasorsim-block-mask.png?alt=media" alt=""><figcaption></figcaption></figure>

{% tabs %}
{% tab title="Network data" %}
Some fields displayed in the **Network Data** tab depend on the selected **Input file format**.

**Common parameters:**

<table><thead><tr><th width="158">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Name</strong></td><td>Unique identifier for the solver block. Use different names when multiple ePHASORSIM Solver blocks are present in the same Simulink model.</td></tr><tr><td><strong>Input file format</strong></td><td>Specifies the network model source. Supported formats are <strong>Excel</strong>, <strong>PSS®E</strong>, <strong>CYME</strong>, and <strong>PowerFactory</strong>. The available configuration fields depend on the selected format.</td></tr><tr><td><strong>Refresh netlist only when simulation starts</strong></td><td><strong>Checked:</strong> Delays model conversion until the simulation starts. This can significantly reduce block update time for large networks.<br><strong>Unchecked:</strong> Conversion is executed immediately when <strong>OK</strong> is clicked.</td></tr></tbody></table>

**Extra parameter when Input file format is Excel:**

<table><thead><tr><th width="134.25">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Complete Network</strong></td><td>Path to the Excel configuration file containing both the network model and I/O pin definitions. Use <strong>Select</strong> to browse for a file or <strong>Open</strong> to open the selected file.</td></tr></tbody></table>

**Extra parameters when Input file format is PSS/e:**

<table><thead><tr><th width="124.25">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>I/O pins file</strong></td><td>Path to the Excel file containing the I/O pin definitions. Use <strong>Select</strong> to browse for a file or <strong>Open</strong> to open the selected file.</td></tr><tr><td><strong>RAW file</strong></td><td>Path to the PSS®E network file (<code>*.raw</code>). Use <strong>Select</strong> to browse for a file or <strong>Open</strong> to open the selected file.</td></tr><tr><td><strong>DYR file</strong></td><td>Path to the PSS®E dynamic data file (<code>*.dyr</code>). Use <strong>Select</strong> to browse for a file or <strong>Open</strong> to open the selected file.</td></tr></tbody></table>

**Extra parameters when Input file format is PowerFactory:**

<table><thead><tr><th width="129.25">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>I/O pins file</strong></td><td>Path to the Excel file containing the I/O pin definitions. Use <strong>Select</strong> to browse for a file or <strong>Open</strong> to open the selected file.</td></tr><tr><td><strong>DGS file (XML format)</strong></td><td>Path to the PowerFactory export file (<code>*.xml</code>). Use <strong>Select</strong> to browse for a file or <strong>Open</strong> to open the selected file.</td></tr><tr><td><strong>Import switches</strong></td><td><strong>Checked:</strong> Includes switches from the PowerFactory model during import.<br><strong>Unchecked:</strong> Excludes switches from the imported model.</td></tr></tbody></table>

**Extra parameters when Input file format is CYME:**

<table><thead><tr><th width="163">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>I/O pins file</strong></td><td>Path to the Excel file containing the I/O pin definitions. Use <strong>Select</strong> to browse for a file or <strong>Open</strong> to open the selected file.</td></tr><tr><td><strong>SXST file</strong></td><td>Path to the CYME network data file. Use <strong>Select</strong> to browse for a file or <strong>Open</strong> to open the selected file.</td></tr><tr><td><strong>Power-flow report (optional)</strong></td><td>Path to a CYME power-flow report used during model conversion. Use <strong>Select</strong> to browse for a file or <strong>Open</strong> to open the selected file.</td></tr></tbody></table>
{% endtab %}

{% tab title="Library" %}

<table><thead><tr><th width="199.25">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>FMU component</strong></td><td>Path to the directory containing the FMU files. The path may be absolute or relative to the model directory. When entered manually, the path must be enclosed in single quotes (<code>'</code>). Alternatively, use the <strong>Path</strong> button to browse to the directory.</td></tr><tr><td><strong>Activate FMU Logger</strong></td><td>Enables logging from FMU components. When enabled, the <strong>Log Level</strong> and <strong>Log Filter</strong> options become available. Because logging introduces additional execution overhead and may cause overruns, it should be used for debugging purposes only.</td></tr><tr><td><strong>Log Level</strong></td><td><p>Sets the minimum severity level that will be reported. Messages below the selected level are ignored. The mapping between FMI statuses and log levels is shown below.</p><p>The following log levels are available:</p><ul><li><strong><code>critical</code></strong>: Displays only <code>fmiFatal</code> messages.</li><li><strong><code>error</code></strong>: Displays <code>fmiError</code> and higher-severity messages.</li><li><strong><code>warn</code></strong>: Displays <code>fmiWarning</code>, <code>fmiDiscard</code>, and higher-severity messages.</li><li><strong><code>info</code></strong>: Displays all FMU log messages, including <code>fmiOk</code> messages.</li></ul></td></tr><tr><td><strong>Log Filter</strong></td><td>Comma-separated list of FMU model names or instance names to include in the log output. If left empty, messages from all FMUs are displayed.</td></tr></tbody></table>
{% endtab %}

{% tab title="Simulation settings" %}

<table><thead><tr><th width="166.75">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Time-step (seconds)</strong></td><td>Solver simulation time step used for both power-flow calculations and dynamic simulations. Ensure the Simulink model is configured to use a fixed-step solver.</td></tr><tr><td><strong>Initialization method</strong></td><td><p>Initial guess used by the Newton-Raphson power-flow solver. Available options are:</p><ul><li><strong>From input data</strong>: Uses the voltage magnitudes and voltage angles specified in the network input data.</li><li><strong>Flat Start</strong>: Initializes all PQ bus voltages to <strong>1 pu</strong> and all bus voltage angles to <strong>0°</strong>.</li><li><strong>Smart Start</strong>: Solves a linear approximation of the power-flow equations to generate an improved initial guess before running the Newton-Raphson solver.</li></ul></td></tr><tr><td><strong>Power mismatch (max p.u.)</strong></td><td>Convergence tolerance for the power-flow calculation (default: <code>1e-8</code>). The solution is considered converged when the mismatch falls below this value.</td></tr><tr><td><strong>Max number of NR iterations</strong></td><td>Maximum number of Newton-Raphson iterations allowed during power-flow calculation (default: <code>100</code>).</td></tr><tr><td><strong>Execute</strong></td><td>Runs the power-flow calculation.</td></tr><tr><td><strong>Execute and export report</strong></td><td>Runs the power-flow calculation and exports the results to the <code>[Excel file name].PowerFlow</code> folder. Generated reports include network composition, bus results, machine results, and convergence statistics.</td></tr><tr><td><strong>Start from Power-flow</strong></td><td><strong>Checked:</strong> A power-flow calculation is executed before the dynamic simulation and the resulting voltages and powers are used to initialize dynamic components.<br><strong>Unchecked:</strong> Initialization uses the values defined in the input data.</td></tr><tr><td><strong>Number of partitions</strong></td><td>Number of network partitions used for parallel execution. The solver automatically partitions the admittance matrix using a graph-partitioning algorithm.</td></tr><tr><td><strong>Export admittance matrix</strong></td><td>Exports the network admittance matrix to <code>[Excel file name]_Y.csv</code>.</td></tr><tr><td><strong>Need more logs?</strong></td><td>Displays instructions for enabling additional diagnostic logging.</td></tr><tr><td><strong>Optimize number of threads (Windows only)</strong></td><td><strong>Checked:</strong> Automatically determines an efficient thread configuration for parallel execution of the network solver and GenUnit integration.<br><strong>Unchecked:</strong> Not recommended.</td></tr></tbody></table>
{% endtab %}

{% tab title="Scripting" %}

<table><thead><tr><th width="163">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Use post-init script</strong></td><td><strong>Checked:</strong> Executes the Python script specified in <strong>Post-init script (*.py)</strong> automatically at the start of the simulation.<br><strong>Unchecked:</strong> ePHASORSIM API functions can still be executed interactively during runtime through the RT-LAB Python API console.</td></tr><tr><td><strong>Post-init script (*.py)</strong></td><td>Name of the Python script to execute automatically at the start of the simulation. The script file must be located in the model directory, and the filename must be enclosed in single quotes (<code>'</code>). For example, <code>'script.py'</code>.</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

## Inputs <a href="#inputs" id="inputs"></a>

This block exposes one input port for each **input pin** defined in the **Pins** worksheet.

Input ports can be scalar or vector signals. For vector ports, the signal width corresponds to the number of power-system signals assigned to the pin in the **Pins** worksheet.

## Outputs <a href="#outputs" id="outputs"></a>

This block exposes one output port for each **output pin** defined in the **Pins** worksheet.

Output ports can be scalar or vector signals. For vector ports, the signal width corresponds to the number of power-system signals assigned to the pin in the **Pins** worksheet.


---

# 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/simulink-blocks-reference/rt-lab-library/ephasorsim-solver.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.
