> 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/phasor-domain-with-ephasorsim/integrate-a-power-system-model-to-ephasorsim/include-fmu-components.md).

# Include FMU Components

## Introduction

In addition to the **Native Library**, ePHASORSIM supports **Modelica-based components** through the **Functional Mock-up Interface (FMI)** standard.

The **ePHASORSIM Modelica Library** provides a collection of power system components implemented in the Modelica language and publicly available on [GitHub](https://github.com/Opal-RT-Technologies/modelica-ephasor-components). The library distributes Modelica source models rather than precompiled FMUs, allowing users to build, customize, and extend models in supported Modelica development environments such as **OpenModelica** and **Dymola**. FMU generation is then handled directly from the Modelica toolchain.

## Requirements

To model and export FMUs, one of the following Modelica authoring tools must be installed on the workstation:

* **Dymola 2019** (release 2018-04-11). **Recommended** for real-time models and simulations.
  * Commercial tool requiring a license. For more information please refer to: [Dymola - Dassault Systèmes](https://www.3ds.com/products-services/catia/products/dymola)
* **OpenModelica 1.16.2 (64-bit)**: <https://build.openmodelica.org/omc/builds/windows/releases/1.16/2/64bit>. Models generated using **OpenModelica 1.16.2** are **not** compatible with RT-LAB's **eXtreme High Performance (XHP)** execution mode and HYPERSIM real-time execution requirements.
  * Open-source tool. For more information please refer to: [Introduction](https://www.openmodelica.org/)

FMUs must be generated from Modelica models built with **MSL 4.0.0** and exported according to the **FMI 1.0 (64-bit Model Exchange)** specification.

{% hint style="info" %}
You do **not** need Dymola or OpenModelica installed on the workstation or simulator to run pre-compiled FMUs in ePHASORSIM.
{% endhint %}

{% hint style="danger" %}
Running **Dymola-generated FMUs** in ePHASORSIM requires the **EPHASOR\_DYMOLA\_FMU** license feature on both the workstation and simulator licenses.
{% endhint %}

## Big picture workflow

{% stepper %}
{% step %}

### Set up & launch OpenModelica or Dymola

1. Download and install the Modelica authoring tool.
2. Clone or download the **ePHASORSIM Modelica Library** from GitHub. The repository contains the Modelica source code, documentation, examples, and tooling required to configure the library, build FMI 1.0-compliant FMUs, and integrate them with ePHASORSIM.

<a href="https://github.com/Opal-RT-Technologies-public/ephasorsim-modelica-library" class="button primary">Click to access the ePHASORSIM Modelica library on GitHub</a>

3. Read the **README.md** provided in the repository and follow the installation instructions to configure the **ePHASORSIM Modelica Library** using the `configure.sh` script. This automatically loads **Modelica Standard Library (MSL 4.0.0)** and the OPAL-RT component hierarchy in the **Libraries Browser** (left pane).
   {% endstep %}

{% step %}

### Model FMU components

Model FMU components using the templates provided in the **ePHASORSIM Modelica Library**. In the **Libraries Browser**, expand the `ePHASORSIM` package (or one of its subpackages, such as `Controllers`, `Exciters`, `Governors`, or `Machines`) and select an appropriate template as the starting point for your model.
{% endstep %}

{% step %}

### Export the FMU and rename the FMU file extension

ePHASORSIM uses architecture suffixes to determine whether to load 32-bit or 64-bit binaries.
{% endstep %}

{% step %}

### Integrate the FMU to ePHASORSIM

Copy the generated FMU files to the ePHASORSIM project directory. Depending on the workflow, update the Excel configuration file, configure FMU I/O pins, and, for imported network models, prepare the required mapping files to associate the FMU with the corresponding network components.
{% endstep %}
{% endstepper %}

## Limitations

* FMU-based models are **supported only in positive-sequence simulations** and cannot be used in multiphase simulations.
* **Single-component FMUs** are only supported through the Excel Template workflow. Direct integration through third-party imports (PSS®E or PowerFactor) is not supported. **GenUnit FMUs**, however, can be integrated with supported import workflows.


---

# 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/phasor-domain-with-ephasorsim/integrate-a-power-system-model-to-ephasorsim/include-fmu-components.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.
