> 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/smart-power-simulation-software-sps/library-specific-guides/machines/three-phase-systems-and-machines.md).

# Three-Phase Systems and Machines

In this section you:

* learn how to simulate a three-phase power system containing electrical machines and other three-phase models.
* simulate the power system and observe its dynamic performance by using and comparing results of the Continuous and Phasor SPS simulation types (continuous and discrete). You can use three types of machines in the SPS > Electrical Machines library: simplified synchronous machines, detailed synchronous machines, and asynchronous machines. You interconnect these machines with linear and nonlinear elements such as transformers, loads, and breakers to study the transient stability of an uninterruptible power supply using a diesel generator.

## Three-Phase Network with Electrical Machines

The two-machine system shown in this single-line diagram represents a diesel generator and asynchronous motor in a distribution network:

<figure><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-4fddadbd3e01ef4c5f50c81cc2609529ea97a03d%2Fdieseil_generator_assynch_motor_distrib_network.png?alt=media" alt=""><figcaption><p>Diesel Generator and Asynchronous Motor on Distribution Network</p></figcaption></figure>

This system consists of a plant (bus B2) simulated by a 1 MW resistive load and a motor load (ASM) fed at 2400 V from a distribution 25 kV system through a 6 MVA, 25/2.4 kV transformer, and from an emergency synchronous generator/diesel engine unit (SM).

The 25 kV system is modeled by a simple R-L equivalent source (short-circuit level 1000 MVA, quality factor X/R = 10) and a 5 MW load. The asynchronous motor is rated 2250 HP, 2.4 kV, and the synchronous machine is rated 3.125 MVA, 2.4 kV.

This system is modeled in the Emergency Diesel-Generator and Asynchronous Motor example.

The SM parameters and the diesel engine and governor models are based on reference \[1].

Initially, the motor develops a mechanical power of 2000 HP and the diesel generator is in standby, delivering no active power. The synchronous machine therefore operates as a synchronous condenser generating only the reactive power required to regulate the 2400 V bus B2 voltage at 1.0 pu. At t = 0.1 s, a three-phase to ground fault occurs on the 25 kV system, causing the opening of the 25 kV circuit breaker at t = 0.2 s, and a sudden increase of the generator loading. During the transient period following the fault and islanding of the motor-generator system, the synchronous machine excitation system and the diesel speed governor react to maintain the voltage and speed at a constant value.

When you simulate this system for the first time, you normally do not know what the initial conditions are for the SM and ASM to start in steady state.

These initial conditions are:

* SM block: Initial values of speed deviation (usually 0%), rotor angle, magnitudes and phases of currents in stator windings, and initial field voltage required to obtain the desired terminal voltage under the specified load flow.
* ASM block: Initial values of slip, rotor angle, magnitudes and phases of currents in stator windings.

Open the Synchronous Machine and Asynchronous Machine blocks. All initial conditions are set at 0, except for the initial SM field voltage and ASM slip, which are set at 1 pu. Open the three scopes monitoring the SM and ASM signals and the bus B2 voltage. Start the simulation and observe the first 100 ms before fault is applied.

As the simulation starts, note that the three ASM currents start from zero and contain a slowly decaying DC component. The machine speeds take a much longer time to stabilize because of the inertia of the motor/load and diesel/generator systems. In our example, the ASM starts to rotate in the wrong direction because the motor starting torque is lower than the applied load torque. Stop the simulation.

To start the simulation in steady state with sinusoidal currents and constant speeds, all the machine states must be initialized properly. This is a difficult task to perform manually, even for a simple system. Use the **Load Flow Analyzer** app in the powergui block to initialize the machines.

## Using the Phasor Solution Method for Stability Studies

When you increase the complexity of your network by adding extra lines, loads, transformers, and machines, the required simulation time becomes longer. Moreover, if you are interested in slow electromechanical oscillation modes (typically between 0.02 Hz and 2 Hz on large systems) you might have to simulate for several tens of seconds, which can result in long simulation times. The conventional continuous or discrete solution method is therefore not practical for stability studies involving low-frequency oscillation modes. For these studies, use the phasor technique (see [Introducing the Phasor Simulation Method](https://www.opal-rt.com/docs/smart-power-simulation-software-sps/simulation-and-analysis/use-the-phasor-simulation-method.md)).

For a stability study, you ignore the fast oscillation modes that result from the interaction of linear R, L, C elements and distributed parameter lines. These oscillation modes, usually above the fundamental frequency (50 Hz or 60 Hz), do not interfere with the slow machine modes and regulator time constants. In the phasor solution method, these fast modes are ignored by replacing the network differential equations with a set of algebraic equations. The state-space model of the network is therefore replaced by a transfer function evaluated at the fundamental frequency and relating inputs (currents injected by machines) and outputs (voltages at machine terminals). The phasor solution method uses a reduced state-space model consisting of slow states of machines, turbines, and regulators, dramatically reducing simulation time.

Two solver types are available for phasor models: continuous and discrete. The type of solver is specified in the powergui block by setting Simulation type to either *Phasor* (continuous) or *Discrete phasor*.

* Continuous phasor solution uses a Simulink variable-step solver. Use a variable-step solver such as **ode23tb** with a maximum time step of one cycle of the fundamental frequency (1/60 s or 1/50 s).
* Discrete phasor uses a local solver to discretize and solve the phasor model at a specified sample time. Discrete phasor allows you to use Simulink Coder to generate code and simulate your model in real time.

{% stepper %}
{% step %}

### Apply phasor method to the example

* Open the Emergency Diesel-Generator and Asynchronous Motor Preview example.
* In the powergui block, set **Simulation type** to `Phasor`.
* Specify the fundamental frequency used to solve the algebraic network equations: enter `60` in the **Frequency** field.
* The powergui icon will show `Phasor 60 Hz` indicating phasor simulation is used.
* Repeat the machine initialization procedure (use Load Flow Analyzer) to start the simulation in steady state.
* Observe that simulation runs much faster and results compare well with continuous-mode simulation.
  {% endstep %}

{% step %}

### Try discrete phasor

* In the powergui block, set **Simulation type** to `Discrete phasor`.
* Specify a sample time of `4e-3` sec.
* Compare synchronous machine waveforms for three simulation types:
  * Continuous (yellow)
  * Phasor (continuous) (cyan)
  * Discrete phasor with a 4 ms sample time (magenta)

<figure><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-4651a16d997ca9f0eae1f67128bdd0836461289a%2F3Pnetwork_elec_machine_results.png?alt=media" alt=""><figcaption></figcaption></figure>

Notes on results:

* Both phasor models (continuous and discrete) compare well with the continuous model.
* The discrete phasor solver uses simplified machine models where stator differential equations are replaced with algebraic equations, eliminating phid and phiq stator flux states. This produces simulation results similar to commercial stability software and typically cleaner waveforms (e.g., high-frequency oscillations and certain glitches are eliminated).
  {% endstep %}
  {% endstepper %}

Contrary to the continuous phasor solver (which uses a full set of machine differential equations for stator and rotor transients), the discrete phasor solver uses lower-order machine models and produces cleaner waveforms. For this example, speed (w) and terminal voltage (Vt) high-frequency oscillations are eliminated and the Vt glitch observed at breaker opening is also eliminated.

The discrete phasor solver also has two additional advantages:

* It uses a robust solution method which allows elimination of machine parasitic loads.
* It allows use of Simulink Coder to generate code and simulate the model in real time.

{% hint style="info" %}
When you set Simulation type to *Discrete phasor*, the two control blocks (Diesel Engine and Governor and Excitation) stay continuous and still use the ode23tb variable-step solver. To simulate the whole model in real time, the entire model must use fixed time steps. Change the variable-step solver to a fixed-step solver that uses the same sample time as the electric network.
{% endhint %}

The phasor solution method is illustrated on more complex networks in these examples:

* Transient stability of two machines with power system stabilizers (PSS) and a static var compensator (SVC) (Static Var Compensator (SVC) and Power System Stabilizers (PSS) Preview model)
* Performance of three power system stabilizers for interarea oscillations (Performance of Three PSS for Interarea Oscillations Preview model)

The phasor solution method is also used for FACTS models. See Improve Transient Stability Using SVC and PSS and Control Power Flow Using UPFC and PST.

## References

\[1] Yeager K.E. and Willis J.R. “Modeling of Emergency Diesel Generators in an 800 Megawatt Nuclear Power Plant.” IEEE Transactions on Energy Conversion. Vol.8, No.3, September 1993.


---

# 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/smart-power-simulation-software-sps/library-specific-guides/machines/three-phase-systems-and-machines.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.
