> 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/micro-grid-with-pv-integration.md).

# Micro Grid with PV Integration

## Description

The **Micro Grid with PV Integration** 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 **phasor18\_MicroGrid**, then click **Finish**.

This demo presents the integration of Photo-Voltaic (PV) system into the three-phase distribution networks. **IEEE 13-node test feeder** \[1] is modified to include single-phase PV sources as shown in figure below.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-50ef517f100eac97321a8ccd224d26f6f6d2dc8c%2FIEEE13_PV.png?alt=media" alt=""><figcaption></figcaption></figure>

The PV model is based on PSS/e's photovoltaic system model, and each of the units includes a converter model of type PVGU1, a controller of type PVEU1, a solar panel model of type PANELU1 and an irradiance profile model of type IRRADU1. These components are modeled in Modelica and interfaced with ePHASORSIM as an FMU using FMI standard.

Compared to \[1], the following modifications are done:

* PV units are connected to buses.
* The distributed load along the line 632 to 671 is replaced by a spot load located at bus 632.
* The voltage regulator between nodes 632 and 650 is substituted by a transformer (Yg-Yg), and a new node 651 is inserted.
* All loads have Yg concoction.

The network data as well as out-port configurations are given in **phasor18\_MicroGrid.xlsx** file.

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

In "Pins" page of this Excel file the following outgoing pins are defined to capture the simulation results:

* Voltage magnitude for buses 650 (phases a,b,c), 632 (phases a,b,c), 671 (phases a,b,c), 684 (phase a), 652\_a (phase a) (volt)
* Voltage angle for buses 650 (phases a,b,c), 632 (phases a,b,c), 671 (phases a,b,c), 684 (phase a), 652\_a (phase a) (degree)
* Active power injection by all PVs (p.u.)
* Reactive power injection by all PVs (p.u.)
* Irradiation profile for all PVs (W/m2)
* Sending active power from bus 651 to bus 632 (kW)
* Sending reactive power from bus 651 to bus 632 (kVar)

## Requirements

* MATLAB R2019b and later

## Simulation and results

The simulation scenario shows the effect of irradiation variations on a microgrid with PV integration. An irradiation profile as depicted in Figure (a) is considered for different PVs in the grid. Such a profile mimics the sunrise an sunset during a normal day. However, for the purpose of this demo a shorter time-frame is assumed for the whole phenomena. The irradiation data for this demo is given in the Excel file, in PVGU1\_PVEU1\_PANELU1\_IRRADU1 sheet, for 6 different (TIMEi, IRRADIATIONi) pairs.

The total active power injection by the PVs and substation bus are shown in Figure (b). It is obvious that increase of the irradiation causes increases in the PV power injection and reduces the the active power injection from the main grid (measured as the sending power from bus 651 to 632). Particularly from t = 7.06s to t = 13.47s, there is a reverse power flow from the microgrid to the main grid.

Figure (c) also shows the total reactive power injection by the PVs as well as reactive power injection from the main grid.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-7b97e50cc9b5f06e681a1f355d41d5675ad99ae1%2FIEEE13_PV-signals.png?alt=media" alt=""><figcaption><p>Simulation results for the proposed scenario. (a) Irradiation profile. (b) Active power injection by PVs and by from main grid. (c) Reactive power injection by PVs and by from main grid.</p></figcaption></figure>

## References

\[1] [IEEE Distribution Test Feeders](http://ewh.ieee.org/soc/pes/dsacom/testfeeders/index.html).


---

# 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/micro-grid-with-pv-integration.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.
