> 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/import-balanced-network-from-powerfactory.md).

# Import Balanced Network from PowerFactory

## Description

The **Import Balanced Network from PowerFactory** 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 **phasor17\_IEEE9**, then click **Finish**.

This demo shows how to import data from DIgSILENT's PowerFactory software into ePHASORSIM. This feature supports exclusively **positive sequence transmission grids** with a limited types of components.

In order to import a **PowerFactory model** into the ePHASORSIM solver, the user must first export the model in the DGS-XML format from PowerFactory's database. The export from PowerFactory is configured by an export definition file which must be first imported into PowerFactory.

In this example IEEE 9bus system is used whose single line diagram is shown in following figure.

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

## Requirements

* OpalOne for Unified Database (UDB)
* MATLAB R2019b and later

## Simulation and results

The in-port and out-port configurations for this model are given in **phasor17\_IEEE9\_pf.xlsx**.

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

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

<details>

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

* Vmag: Bus voltage magnitude (p.u.)
* Delta: Machine's rotor angle for all synchronous generators (rad)
* Slip: Machine's speed deviation for all synchronous generators (p.u.)
* Tm: Generated mechanical torque by turbine governors connected to the Machines (p.u.)
* Efd: Machines' field voltage provided by the exciters (p.u.)
* LineCurrent: Current magnitude (p.u.) on the sending node for line between buses 4 and 6

</details>

<details>

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

* Fault: 3-phase-to-ground fault for bus *9*
* LineStatus: in-service/out-of-service commands for line 1 between buses *4* and *5*
* SwitchStatus: On/Off commands for switch between bus *4* and line *6*

</details>

The following simulation scenario is demonstrated for this test case:

* At t = 1s, apply a 3-phase-to-ground fault on bus 9.
* At t = 1.08s, remove the fault on bus 7.
* At t = 5s, trip the line between buses 4 and 5.
* At t = 6s, switch the line between buses 4 and 5 back in service.
* At t = 10s, open the switch between bus 4 and line 6.
* At t = 12s, close the switch between bus 4 and line 6.


---

# 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/import-balanced-network-from-powerfactory.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.
