> 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/phasor01_ieee39.md).

# Basic Model for Balanced Systems (positive sequence)

## Description

The **Basic Model for Balanced Systems (positive sequence)** 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 **phasor01\_IEEE39**, then click **Finish**.

The following figure shows the IEEE 39-bus system which is used to show the basic features of ePHASORSIM for simulation of transmission systems in the positive sequence domain.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-4c0ce67d834c1baddd33648fd6b20c1e7cafbc0e%2Fphasor03_PSSE.jpg?alt=media" alt=""><figcaption><p>IEEE 39-bus network diagram.</p></figcaption></figure>

This test system has been modified compared to the standard 39-bus system. The reactive part of loads at bus 4, 16 & 18 were replaced by fixed shunt component and the two 2-winding transformer among buses 11, 12, 13 were replaced by one 3-winding transformer.

{% hint style="info" %}
This model is configured to assign core number 2 for the dynamic simulation on a target. The `EPHASOR_THREADS` environment variable can be revised in the Variables tab of RT-LAB GUI to modify this configuration.
{% endhint %}

## Requirements

* MATLAB R2019b and later

## Simulation and results

The network data as well as in-port and out-port configurations are given in the following file.

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

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

<details>

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

* Voltage at buses *4, 9, 16, 26, 29, 30, 31, 32, 34, 39*
* Machine's rotor angle for all synchronous generators
* Machine's speed for all synchronous generators
* Tap's position for transformer *xf1*
* Reference voltage of excitation system for machine *m1*
* Mechanical power of machine *m2*
* Injected current and bus voltage for machine *m2*
* In-service status of load *ld7*
* Current flow on line *ln33*

</details>

<details>

<summary>Incoming pins (control commands)</summary>

* 3-phase-to-ground fault on buses *2, 4, 7, 30, 34, 39*
* Adjust tap position for transformer *xf1*
* Adjust P and Q for load *ld4*
* In-service/out-of-service command for load *ld7*
* In-service/out-of-service commands for line *ln15*
* Fault on line *ln33* with variable distance from the sending end

</details>

For the demo purpose some of the above mentioned incoming pins get activated in the console subsystem:

* At t = 1s and for a duration of 80ms, a fault is applied on bus *30*
* At t = 5s, the ratio of winding 1 of transformer *xf1* changes to 0.9 p.u.
* At t = 9s, load *ld7* gets out-of-service command


---

# 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/phasor01_ieee39.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.
