> 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/pe-add-on-simulink/simulation-control-monitoring-and-logging/simulate-a-three-phase-voltage-source-using-sinewave-generators.md).

# Simulate a Three Phase Voltage Source using Sinewave Generators

Source components in the eHS circuit model can be mapped to a variety of incoming signals, allowing them to act as either AC or DC sources depending on the characteristics of the mapped signal (sinusoidal versus constant). We can leverage the **Sinewave Generators** to simulate a three phase AC voltage source.

1. Build a model containing three voltage sources as in this example. The sources can be controlled or uncontrolled.

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2FhIBsnsq8YLPlDQkxXRAt%2Fimage.png?alt=media&amp;token=494c79d1-e095-4538-9acc-30e96cafd808" alt=""><figcaption></figcaption></figure>

2. Navigate to the **Sources page** and locate the three voltage sources. Map each one to a different **Sinewave Generator**, as shown below. In this case, we will use *SWG00*, *SWG01*, and *SWG02*.

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2FFfo2t0Gq1AoR10T9xcP3%2F38fdc9ef-6bdc-46a1-b305-518e1becff99.png?alt=media&amp;token=cb17acb7-7cde-4758-9661-46d06b460bc0" alt=""><figcaption></figcaption></figure>

3. In the Configuration Tree, expand the **Sinewave Generators** **>> Frequency Engines** section and select the **Frequency Engine 0** channel. Set its default value to the desired frequency (in Hertz) of the three phase voltage source.
4. In the Configuration Tree, expand the section for each Sinewave Generator mapped to the voltage sources. In this example, we will expand **SWG 0**, **SWG 1**, and **SWG 2.** For each of the three Sinewave Generators, set the **Frequency Engine** channel to 0. This will link the generator to Frequency Engine 0.
5. Provide default values for the **Amplitude** channels of all three Sinewave Generators.
6. Under **SWG 1**, set the **Phase** channel to 120 degrees. Under **SWG 2**, set the **Phase** channel to -120 degrees.

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2F1W5iBczIiBMAkjxBZEFI%2Fee4d0a1f-1e03-48a1-8789-42d78e9a8d2d.png?alt=media&amp;token=e5d8f285-4a6d-4cc1-9561-09acbe9d41a1" alt=""><figcaption></figcaption></figure>

7. **Save** the System Definition file and run the simulation. The voltage source blocks in the circuit model will behave as a synchronized three phase voltage source with a 120 degree phase shift between each signal.


---

# 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/pe-add-on-simulink/simulation-control-monitoring-and-logging/simulate-a-three-phase-voltage-source-using-sinewave-generators.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.
