> 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/integrate-a-power-system-model-to-ephasorsim/build-a-model-with-excel.md).

# Build a Model With Excel

ePHASORSIM can simulate power system models built using **ePHASORSIM** [Native Library components](https://www.opal-rt.com/docs/rt-lab/model-and-simulation/phasor-domain-with-ephasorsim/integrate-a-power-system-model-to-ephasorsim/native-library-components.md) defined in an Excel configuration file. During simulation initialization, ePHASORSIM interprets the network data and generates the data structures required by the solver.

ePHASORSIM provides two categories of power system components:

* **Positive-sequence components** for balanced network simulations.
* **Multiphase components** for unbalanced network simulations.

{% hint style="info" %}
Models built with Excel support both **positive-sequence** and **multiphase components**.
{% endhint %}

## Requirements

### Simulator and workstation license

Building models using the **Excel Template** configuration file is included with the standard ePHASORSIM license and does not require any additional licensed features.

## Modeling workflow

Follow these steps to build a power system model in the Excel Template configuration file:

{% stepper %}
{% step %}

### Open the Excel configuration file

Open the Excel configuration file from your model directory.

The template includes preconfigured worksheets for all supported components, along with field comments describing the required inputs and expected data format. You may use the [Native Library Components](https://www.opal-rt.com/docs/rt-lab/model-and-simulation/phasor-domain-with-ephasorsim/integrate-a-power-system-model-to-ephasorsim/native-library-components.md) documentation as a reference when completing the Excel worksheets.

Use **positive-sequence components** for positive-sequence networks and **multiphase components** for multiphase networks.
{% endstep %}

{% step %}

### Define the buses

Define all buses before adding any other network elements, since most components reference existing bus identifiers.

For each bus:

* Assign a unique **Bus ID**.
* Specify the **base voltage**.
* Select the appropriate bus type:
  * **Slack (Swing)**: Reference bus for voltage magnitude and angle.
  * **PV**: Generator bus with specified active power and voltage.
  * **PQ**: Load or connection bus.
    {% endstep %}

{% step %}

### Build the network topology

Connect the buses using the appropriate network components:

* **Lines** to represent transmission or distribution connections.
* **Transformers** to connect voltage levels and winding configurations.
* **Switches** to represent breakers and disconnectors.

Be sure to use component models that match the selected network type (positive-sequence or multiphase).
{% endstep %}

{% step %}

### Add loads and static devices

Connect static components to the network buses.

Examples include:

* **Loads** (PQ, constant-current, constant-impedance, or ZIP).
* **Shunts** (capacitors and reactors).
* **Voltage Sources**.
* **Current Sources** and **Current Injectors**.

Again, select the appropriate component type for the network being modeled.
{% endstep %}

{% step %}

### Add machines and controls

Add dynamic generation and associated control systems.

Typical component relationships are:

* **Machine** connected to a bus.
* **Exciter** linked to a Machine.
* **Turbine and Governor** linked to a Machine.
* **Power System Stabilizer (PSS)** linked to the corresponding Machine and Exciter.

Each machine must have a unique identifier that can be referenced by associated control models.
{% endstep %}

{% step %}

### Configure faults (multiphase only)

Configure fault scenarios as required for testing and contingency analysis.

For **multiphase networks**, fault components must be defined in the **Multiphase Fault** worksheet to apply faults through I/O pins.

For **positive-sequence networks**, faults are applied through I/O pins and do not require a dedicated fault component in the Excel Template.
{% endstep %}

{% step %}

### Include FMU components (optional)

FMUs can be used to extend the Native Library with custom machines, controllers, or other Modelica-based components. If your model requires **FMU-based components**, continue to the [Include FMU Components](https://www.opal-rt.com/docs/rt-lab/model-and-simulation/phasor-domain-with-ephasorsim/integrate-a-power-system-model-to-ephasorsim/include-fmu-components.md) section for instructions.
{% endstep %}

{% step %}

### Configure block ports

With the power system model now defined, continue to the [Configure ePHASORSIM Block Ports](https://www.opal-rt.com/docs/rt-lab/model-and-simulation/phasor-domain-with-ephasorsim/configure-ephasorsim-block-ports.md) section to define the signals that will be exchanged between the ePHASORSIM power system model and the surrounding Simulink environment.
{% endstep %}
{% endstepper %}

## Key rules and best practices

* **Keep worksheet names unchanged.** Use the predefined worksheet names exactly as provided. Unused worksheets may be left empty or deleted.
* **Preserve the worksheet structure.** Do not modify header rows, reorder columns, or change the order of component blocks. In Excel Template v2.0, a single empty row between blocks is mandatory.
* **Use comments instead of deleting data.** To temporarily disable a row, enter `//` in the leftmost cell.
* **Remove permanently inactive components.** Components with `Status = 0` that will never be enabled during the simulation should be removed to reduce memory usage and improve performance.
* **Leave unused parameters empty.** If a parameter does not apply to a specific component instance, leave the corresponding cell blank.
* **Use unique identifiers.** Component IDs, bus names, and other identifiers must be unique within the model.
* **Use the correct component type.** Ensure that all components are compatible with the selected network type (**positive-sequence** or **multiphase**) and avoid mixing incompatible component models.


---

# 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/integrate-a-power-system-model-to-ephasorsim/build-a-model-with-excel.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.
