> 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/example-models/ephasorsim-example-models/phasor-emt-simulation.md).

# PHASOR-EMT Simulation

## Description

The **PHASOR-EMT Simulation** example can be created by starting a new RT‑LAB project. From the menu bar, select **File > New > RT‑LAB Project**. Enter a name and location for your project, then click **Next**. From the available templates list, navigate to **ePHASORsim** and select **phasor26\_EMT**, then click **Finish**.

{% hint style="danger" %}
This model contains 2 subsystems. At least **4 physical cores** on the target hardware are required to run in real-time.
{% endhint %}

This demo showcases a multi-rate PHASOR-EMT simulation.

A WSCC 9-bus transmission network with 3 machines is simulated using ePHASORSIM with a time step of 2ms. This network is connected, at bus 6, to a 5-node distribution feeder (Figure 1). The distribution feeder, containing an induction motor, and is run at 20us in a EMT simulation (Figure 2).

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-58006999b9385e8449a8299d09ea5ab4d33a64ac%2FWholeDemo.png?alt=media" alt=""><figcaption><p>Figure 1. - WSCC 9-bus power system [1] and Feeder connected to the PHASOR/EMT simulation.</p></figcaption></figure>

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-72fe8824cc9edea476f25cc35179233a15e5d496%2FFeeder.png?alt=media" alt=""><figcaption><p>Figure 2. - Distribution Feeder connected on bus 6 of the transmission network.</p></figcaption></figure>

{% hint style="info" %}
The PHASOR and EMT time steps must be chosen in accordance with the number of samples in order for the monitoring to work
{% endhint %}

The PHASOR voltage of bar 6 is transformed to an instantaneous three-phase source that is used as input voltage to the distribution system. This three-phase voltage source produces current circulation through the feeder and allows the calculation of the active and reactive power that is fed back to the transmission system in bar 6.

The in-port and out-port configurations and the network/dynamic data for the transmission network are given in **phasor26\_PHASOR\_EMT.xlsx** file.

{% file src="/files/rK7z0mtDcG4JjuyEeaqo" %}

In the "Pins" page of the Excel file the following outgoing and incoming pins are assigned:

<details>

<summary>Outgoing pins (measurements)</summary>

* Vmag: Voltage magnitude of all the buses (p.u.)
* Vang: Voltage angle of all the buses (degree)

</details>

<details>

<summary>Incoming pin (control command)</summary>

* Three-phase Fault: Activation/deactivation of a solid three-phase fault on the bus of interest
* load: Active and Reactive power of the load located on bus 6 (MW, MVar)

</details>

## Requirements

* MATLAB R2019b and later

## Simulation and results

In this demo, 2 three-phase faults are simulated: 1) in the 69 kV bus of the feeder (t=2.5 s and 30 cycles of duration) and 2) in bus 4 of the transmission system (t=6s, 3 cycles of duration).

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-7e3529d1e568b48ef585a243f5d0c3afde4fa555%2Fresults1.png?alt=media" alt=""><figcaption><p>Figure 3. - Simulation results for the proposed scenario (PHASOR results on transmission system).</p></figcaption></figure>

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-32c558a2c0f001e98d8df2cca226302d005922a0%2Fresults2.png?alt=media" alt=""><figcaption><p>Figure 4. - Simulation results for the proposed scenario (EMT results on distribution feeder).</p></figcaption></figure>

## References

\[1] Identification of a continuos time nonlinear state space model for the external power system dynamic equivalent by neural networks, DOI:10.1016/j.ijepes.2009.03.016.

{% file src="/files/mGk2uoIIVsTM7Q4cLoqG" %}


---

# 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/example-models/ephasorsim-example-models/phasor-emt-simulation.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.
