Main Content

In this section you

Learn how to simulate a three-phase power system containing electrical machines and other three-phase models

Perform a load flow study and initialize machines to start simulation in steady state by using the Machine Initialization and Load Flow tools (positive-sequence load flow and unbalanced load flow) of the powergui block.

Simulate the power system and observe its dynamic performance by using and comparing results of the Continuous and Phasor Simscape™ Electrical™ Specialized Power Systems simulation types (continuous and discrete).

You now use three types of machines in the **Simscape** > **Electrical** > **Specialized Power Systems** > **Fundamental Blocks** > **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.

The two-machine system shown in this single line diagram is this section's main example:

**Diesel Generator and Asynchronous Motor on
Distribution Network**

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.

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.

This system is modeled in the `power_machines`

example.

The SM parameters as well as the diesel engine and governor models were taken from reference [1].

If 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 dialog box of the Synchronous Machine and Asynchronous
Machine blocks. All initial conditions should be 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 as well as 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 even starts to rotate in the wrong direction because the motor starting torque is lower than the applied load torque. Stop the simulation.

[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.

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.
In the next section you learn how to use the **Machine
Initialization **tool of the powergui block
to initialize the machines.

In the

**Tools**tab of the powergui block dialog box click the**Machine Initialization**button. A new window appears. The upper-right window displays a list of the machines appearing in your system.Select

`SM 3.125 MVA`

in the machine list. The**Bus Type**parameter should already be initialized as`P & V generator`

, indicating that the machine is controlling its active power and terminal voltage. For more info on the meaning of the**Bus type**parameter see Load Flow Tool.Check that the desired

**Terminal Voltage UAB**is initialized at the nominal machine voltage (2400 Vrms).Set the

**Active Power**to zero. The synchronous machine therefore absorbs or generates reactive power only to keep terminal voltage at 1 pu.Select

`ASM 2250 HP`

in the machine list. The only parameter that needs to be set is the**Mechanical power**developed by the motor. Enter`1.492e6`

(2000 HP = 2000*746 watts).Click the

**Compute and Apply**button. The three phasors of line-to-line machine voltages, as well as currents, are updated as shown on the next figure. Values are displayed both in SI units (volts RMS or amperes RMS) and in pu.The

**Machine info**section displays the SM active and reactive powers, mechanical power, and field voltage, the ASM active and reactive powers absorbed by the motor, slip, and torque.Close the

**Machine Initialization**tool.Open the SM and ASM block dialogs and see that the initial conditions have been updated. Note that the ASM torque value (7964 N.m) has been entered in the Constant block connected at the ASM torque input.

Double-click the Diesel Engine Governor block. The initial mechanical power is set to

`0.0002701`

pu.Open the Excitation block. Double-click the AC1A Excitation System block and select the

**Initial Values**tab. The initial terminal voltage and field voltage are set to`1.0`

pu and`1.427`

pu, respectively.The

**Machine Initialization**tool also initializes the Constant blocks connected at the reference inputs (wref and vref) of the Governor and Excitation blocks, as well as the Constant block connected at the load torque input (Tm) of the Asynchronous Machine block.Start the simulation. Open the three scopes displaying the internal signals of synchronous and asynchronous machines and phase A voltage. The simulation starts in steady state.

**Note**

To initialize machines, you can use the Load Flow tool instead of the Machine Initialization tool. The Load Flow tool allows you to display a more detailed load flow solution.

The **Load Flow ** tool of the powergui block
uses the Newton-Raphson method and comes with a user interface that
allows you to display load flow solution at all buses.

Simscape Electrical Specialized Power Systems allows you to perform two types of load flows:

Positive-sequence load flow applied to a three-phase system. Positive-sequence voltages as well as active power (P) and reactive power (Q) flows are computed at each three-phase bus.

Unbalanced load flow applied to a mix of three-phase, two-phase, and single-phase systems. Individual phase voltage and PQ flow are computed for each phase.

For more information, see `power_loadflow`

.

To solve a load flow, you need to determine these four quantities at each three-phase or single-phase bus:

The net active power P and reactive power Q injected into the bus

The voltage magnitude V and angle Vangle of bus positive-sequence voltage (positive-sequence voltage or phase voltage)

It is important that you understand the three bus types that are used by the Load Flow tool to solve a load flow. Before solving the load flow, two of the above quantities are known at every bus and the other two are to be determined. Therefore, the following bus types are used:

PV bus—For this type of bus, specify

`P`

and`V`

. This is the generation bus where a generator such as a voltage source or three-phase synchronous machine is connected. Active power`P`

is generated and generator terminal voltage`V`

is imposed. The load flow solution returns the machine reactive power`Q`

, required to maintain the reference voltage magnitude`V`

, and the reference voltage angle`Vangle`

.PQ bus — At this bus, specified active power

`P`

and reactive power`Q`

are either injected into the bus (generation PQ bus) or absorbed by a load connected at that bus. The load flow solution returns bus voltage magnitude`V`

and angle`Vangle`

.Swing bus—This bus imposes voltage magnitude

`V`

and angle`Vangle`

. The load flow solution returns the active power`P`

and reactive power`Q`

, generated or absorbed at that bus in order to balance generated power, loads, and losses. At least one bus in the model must be defined as a swing bus, but usually a single swing bus is required unless you have isolated networks. Normally for a positive-sequence load flow, you select one synchronous machine or voltage source as a swing bus. For an unbalanced load flow, you can select the three phases of a Three-Phase Voltage Source block or single-phase AC Voltage Source blocks as swing buses.

To perform a load flow analysis and initialize your model so that it starts in steady state:

Define the model buses using Load Flow Bus blocks.

Specify the load flow parameters of all blocks having load flow parameters. These blocks are referred to as load flow blocks.

Solve the load flow and, eventually, interactively modify the load flow parameters until a satisfactory solution is obtained.

Save the load flow parameters and machine initial conditions in the model.

The load flow blocks and the Load Flow Bus block are described in the next sections.

Load flow blocks are Simscape Electrical Specialized Power Systems blocks in which you can specify active power (P) and reactive power (Q) to solve the positive-sequence load flow. They are:

Asynchronous Machine

Simplified Synchronous Machine

Synchronous Machine

Three-Phase Dynamic Load

Three-Phase Parallel RLC Load

Three-Phase Series RLC Load

Three-Phase Programmable Voltage Source

Three-Phase Source

You specify P and Q in the **Load Flow** tab
of the block dialog boxes.

**Load Flow Parameters of Three-Phase Sources and Synchronous
Machines. **The Three-Phase Sources and Synchronous
Machine blocks allow control of their generated or absorbed
powers P and Q and their positive-sequence terminal voltage. You can
specify the generator bus type as swing, PV, or PQ.

**Load Flow Parameters of Asynchronous Machine Blocks. **The Asynchronous Machine block requires specification
of the mechanical power `Pmec`

at the machine shaft.

**Load Flow Parameters of the RLC Load Blocks. **You can specify the Three Phase RLC Load blocks
as constant impedance (Z), constant PQ power, or constant current
(I).

**Load Flow Parameters of Dynamic Load Blocks. **The Three-Phase Dynamic Load block dialog box
does not have a **Load Flow** tab. The load is always
considered as a constant PQ load. P and Q are the initial active and
reactive power `Po`

, `Qo`

that you
specify by using the **Active and reactive power at initial
voltage** parameter. The **Initial positive-sequence
voltage Vo** parameter (Mag and Phase) updates according
to the load flow solution.

Load flow blocks are Simscape Electrical Specialized Power Systems blocks in which you can specify active power (P) and reactive power (Q) to solve the load flow at each phase of every bus. They are:

AC Voltage Source

Asynchronous Machine

Parallel RLC Load

Series RLC Load

Synchronous Machine

Three-Phase Dynamic Load

Three-Phase Parallel RLC Load

Three-Phase Series RLC Load

Three-Phase Source

You specify P and Q in the **Load Flow** tab
of the block dialog boxes.

**Load Flow Parameters of Single-Phase and Three-Phase Sources. **The single-phase AC Voltage Source block allows
control of its generated or absorbed powers P and Q and its terminal
voltage. The Three-Phase Source block allows control
of generated or absorbed powers P and Q and terminal voltages for
each phase (phase A, B, and C). For these two blocks, you can specify
the generator type as swing, PV, or PQ.

**Load Flow Parameters of Synchronous Machine. **The Three-Phase Synchronous Machine block allows
control of its generated or absorbed powers P and Q (total of phases
A, B, and C) and its positive-sequence terminal voltage. You can specify
the generator type as PV or PQ.

**Load Flow Parameters of Asynchronous Machine Blocks. **The Asynchronous Machine block requires specification
of the mechanical power Pmec developed in positive-sequence at the
machine shaft.

**Load Flow Parameters of the RLC Load Blocks. **You can specify the single-phase and three-phase RLC
Load blocks as constant impedance (Z), constant PQ power,
or constant current (I). You can connect single-phase loads phase-to-ground
or phase-to-phase. You can connect three-phase loads connected in
Wye (grounded or floating) or delta.

**Load Flow Parameters of Dynamic Load Blocks. **The Three-Phase Dynamic Load block dialog box
does not have a **Load Flow** tab. The load is always
considered as a constant PQ load. P and Q are the initial active and
reactive power `Po`

, `Qo`

that you
specify by using the **Active and reactive power at initial
voltage** parameter. The **Initial positive-sequence
voltage Vo** parameter (Mag and Phase) updates according
to the load flow solution.

Use the Load Flow Bus block to define the buses in your model.

If you perform a positive-sequence load flow, you connect a Load
Flow Bus block with the **Connectors** parameter
specified as `single`

to any phase (A, B,
or C) of every load flow block in the model. When several load flow
blocks are connected together at the same nodes, only one Load
Flow Bus block is required to identify the bus.

If you perform an unbalanced load flow, you connect a Load
Flow Bus block to all phases of every load flow block in the
model. Depending on the number of phases, you need to specify the
appropriate **Connectors** parameter by selecting
either three connectors (ABC), two connectors (AB, AC, or BC) or a
single connector (A, B, or C). When several load flow blocks are connected
together at the same nodes, only one Load Flow Bus block
is required to identify the bus. In the load flow report, each bus
is identified by its **Bus identification** parameter
followed by _a, _b, or _c.

These examples show the use of load flow blocks and Load Flow Bus blocks:

`power_LFnetwork_5bus`

shows a positive-sequence load flow on a five-bus system.`power_13nodeTestFeeder`

shows an unbalanced load flow on a 13-bus system (mix of three-phase, two-phase, and single-phase buses).

In the Command window, type `power_LFnetwork_5bus`

to
access a model containing five Load Flow Bus blocks
and six load flow blocks.

The Load Flow Bus blocks are shown in orange and the load flow blocks are shown in yellow.

The Load Flow Bus blocks specify the bus base voltages (nominal phase-to-phase rms voltage). They also specify the voltage at PV buses or the voltage and angle of the swing buses. Once the load flow is solved, the Load Flow Bus block displays the bus positive-sequence voltage magnitude and phase angle as block annotations.

The bus type (PV, PQ, or swing) is determined by the load flow
blocks connected to the bus. If you have several load flow blocks
with different types (specified in the **Generator type** parameter
or in the **Load type** parameter) connected to the
same bus, the Load Flow tool determines the resulting bus type (swing,
PQ, or PV).

In the `power_LFnetwork_5bus`

example, the
bus types are determined as follows:

Bus | Load Flow Blocks | Resulting Bus Type |
---|---|---|

| 120 kV Three-Phase Source | swing (Specify voltage and angle in the B120 Load Flow Bus block.) |

| 13.8 kV 150 MVA Synchronous Machine 3 MW 2 Mvar RLC Load | PV (Specify voltage in the B13.8 Load Flow Bus block.) |

| 10 MW, 3 Mvar Dynamic Load | PQ |

| No load flow block | PQ |

| Asynchronous generator 9 MW | PQ (Constant Z load is included in the Ybus admittance matrix.) |

Some restrictions apply when you connect several source blocks and synchronous machines at the same bus:

Two swing generators cannot be connected in parallel.

A swing generator cannot be connected in parallel with a PV ideal voltage source.

When a swing voltage source with RL impedance is connected to a PV generator, the swing bus is automatically moved to the ideal voltage source connection node, behind the RL source impedance.

Only one PV generator with finite Q limits can be connected at a generation bus. However, you may have other PQ generators and loads connected on the same bus.

For more information on how to use the Load Flow Bus block in your model, see the Load Flow Bus block reference page.

Once you have entered the load flow parameters in the Load Flow Bus
blocks and in the various load flow blocks, open the load flow tool by clicking the
**Load Flow** button of the powergui block. The tool
displays a summary of the load flow data of the model. The table below shows the data
found in the `power_LFnetwork_5bus`

model.

Note that the table contains seven lines, whereas there are only six load flow blocks in the model. This is because the bus B25_2 is not connected to any load flow block. Line 5 is added in the table for that particular bus, so that you can see all buses listed together with their bus voltages. This bus will be considered in the load flow analysis as a PQ bus with zero P and Q.

The first column identifies the block type. The second column displays the bus type of
the load flow blocks. The following four columns give the bus identification label, the
bus base voltage, the reference voltage (in pu of base voltage) and the voltage angle of
the load flow bus where the block is connected. The following columns are the P and Q
values specified in the **Load Flow** tab of the blocks.

The last five columns display the current load flow solution, as well as the full block name of the load flow block. For now, the load flow has not yet been performed and the columns display zero values.

The load flow parameters in the **Preferences** tab of the Powergui
are used to build the Ybus network admittance matrix and to solve the load flow. The base
power is used to specify units of the normalized Ybus matrix in pu/Pbase and bus base
voltages. The `power_LFnetwork_5bus`

model contains five buses;
consequently, the Ybus matrix will be a 5x5 complex matrix evaluated at the frequency
specified by the **Frequency (Hz)** parameter.

The load flow algorithm uses an iterative solution based on the Newton-Raphson method.
The **Max iterations** parameter defines the maximum number of
iterations. The load flow algorithm will iterate until the P and Q mismatch at each bus is
lower than the **PQ tolerance** parameter (in pu/Pbase). The power
mismatch is defined as the difference between the net power injected into the bus by
generators and PQ loads and the power transmitted on all links leaving that bus.

To avoid a badly conditioned Ybus matrix, you should select the **Base
power** parameter value in the range of nominal powers and loads connected to
the network. For a transmission network with voltages ranging from 120 kV to 765 kV, a 100
MVA base is usually selected. For a distribution network or for a small plant consisting
of generators, motors, and loads having a nominal power in the range of hundreds of
kilowatts, a 1 MVA power base is better adapted.

To solve the load flow, click the **Compute** button. The load flow
solution is then displayed in the last five columns of the table.

To display the load flow report showing power flowing at each bus, click the
**Report** button. You can also save this report in a file by
specifying the file name at the prompt.

The report starts with displaying the summary of active and reactive powers, showing total PQ sharing between generators (SM and Vsrc type blocks), PQ loads (PQ type RLC loads and DYN loads), shunt constant Z loads (Z type RLC loads and magnetizing branches of transformers) and asynchronous machine loads (ASM):

The Load Flow converged in 2 iterations ! SUMMARY for subnetwork No 1 Total generation : P= 5.61 MW Q= 25.51 Mvar Total PQ load : P= 13.00 MW Q= 5.00 Mvar Total Zshunt load : P= 0.68 MW Q= -0.51 Mvar Total ASM load : P= -8.90 MW Q= 4.38 Mvar Total losses : P= 0.83 MW Q= 16.64 Mvar

The `Total losses`

line represents the difference between generation
and loads (PQ type + Z type +ASM). It therefore represents series losses. After this
summary, a voltage and power report is presented for each bus:

1 : B120 V= 1.020 pu/120kV 0.00 deg ; Swing bus Generation : P= -114.39 MW Q= 62.76 Mvar PQ_load : P= 0.00 MW Q= 0.00 Mvar Z_shunt : P= 0.25 MW Q= 0.23 Mvar --> B13.8 : P= -116.47 MW Q= 53.89 Mvar --> B25_1 : P= 1.84 MW Q= 8.63 Mvar 2 : B13.8 V= 0.980 pu/13.8kV -23.81 deg Generation : P= 120.00 MW Q= -37.25 Mvar PQ_load : P= 3.00 MW Q= 2.00 Mvar Z_shunt : P= 0.17 MW Q= 0.17 Mvar --> B120 : P= 116.83 MW Q= -39.42 Mvar 3 : B25_1 V= 0.998 pu/25kV -30.22 deg Generation : P= 0.00 MW Q= 0.00 Mvar PQ_load : P= 10.00 MW Q= 3.00 Mvar Z_shunt : P= 0.25 MW Q= 0.21 Mvar --> B120 : P= -1.83 MW Q= -8.44 Mvar --> B25_2 : P= -8.41 MW Q= 5.23 Mvar 4 : B25_2 V= 0.967 pu/25kV -20.85 deg Generation : P= 0.00 MW Q= 0.00 Mvar PQ_load : P= -0.00 MW Q= -0.00 Mvar Z_shunt : P= 0.01 MW Q= -0.03 Mvar --> B25_1 : P= 8.87 MW Q= -3.67 Mvar --> B575 : P= -8.88 MW Q= 3.70 Mvar 5 : B575 V= 0.953 pu/0.575kV -18.51 deg Generation : P= 0.00 MW Q= 0.00 Mvar PQ_load : P= -0.00 MW Q= -0.00 Mvar Z_shunt : P= 0.01 MW Q= -1.09 Mvar --> ASM : P= -8.90 MW Q= 4.38 Mvar --> B25_2 : P= 8.89 MW Q= -3.29 Mvar

For every bus, the bus voltage and angle are listed on the first line. The next 3 lines give the PQ generated at the bus (all SM and voltage sources), the PQ absorbed by the PQ type loads, and the PQ absorbed by the Z type loads.

The last lines, preceded by an arrow (`-->`

), list the PQ
transmitted to neighbor buses connected through lines, series impedances, and
transformers, as well power absorbed by ASM.

When performing a load flow analysis, you may need to iterate on P, Q, V values until you find satisfactory voltages at all buses. This may require, for example, changing generated power, load powers, or reactive shunt compensation.

To change the load flow setup, you need to edit the parameters
of the load flow blocks and of the Load Flow Bus blocks.
Then click the **Update** button to refresh the
load flow data displayed by the table. The previous load flow solution
is then deleted from the table. Click the **Compute** button
to obtain a new load flow solution corresponding to the changes you
made.

Once you have obtained a satisfactory load flow, you need to
update the model initial conditions according to the load flow solution.
Click the **Apply to Model** button to initialize
the machine blocks of the model, as well as the initial conditions
of regulators connected to the machines.

Open the Three-Phase Parallel RLC Load block
connected at the B13.8 bus. As the **Load type** specified
in the **Load Flow** tab is constant PQ, the nominal
voltage of this block has been changed to the corresponding bus voltage
of 0.98 pu. The **Nominal phase-phase voltage** parameter
is set to `(13800)*0.98`

.

Open the Three-Phase Dynamic Load block connected
at the B25_1bus. The **Initial positive-sequence voltage Vo** is
set to `[0.998241 pu -30.2228 deg]`

.

Note that the voltage magnitudes and angles obtained at each bus have been written as block annotations under the Load Flow Bus blocks.

Open the scope and start the simulation.

The Three-Phase Fault block has been programmed to apply a six-cycle fault at B120 bus.

Observe waveforms of SM active power, SM and ASM speeds, and PQ of DYN load, and notice that simulation starts in steady state.

At the command prompt, enter power_13NodeTestFeeder to open a model containing 12 Load Flow Bus blocks and 13 load flow blocks. This model is a benchmark network taken from the “Radial Distribution Test Feeder” Distribution System Analysis Subcommittee Report, Power Engineering Society, pages 908–912, 2001.

The original benchmark system contains 13 nodes. However, as the power_13NodeTestFeeder model does not include the regulating transformer, it contains only 12 nodes.

The Load Flow Bus blocks are shown in orange and the Load Flow blocks are shown in yellow.

The Load Flow Bus blocks specify the bus base voltages (nominal phase-to-ground rms voltage). They specify the voltage at PV buses or the voltage and angle of the swing buses. Once the load flow is solved, the Load Flow Bus block displays the bus voltage magnitude and phase angle as block annotations.

**Note**

By default the block annotations are set in the **Block
Annotation** tab of the Load Flow Bus block
properties to display the phase A magnitude (<VLF> parameter)
and the phase A angle (<angleLF> parameter). To display phase
B magnitude and angle, specify <VLFb> and <angleLFb>,
respectively. To display phase C magnitude and angle, specify <VLFc>
and <angleLFc>, respectively.

You can also delete some block annotations. In the `power_13NodeTestFeeder`

example,
only the bus identification is displayed (<ID> parameter).

The bus type (PV, PQ, or swing) is determined by the load flow blocks connected to the bus. If you have several load flow blocks with different types (specified in the Generator type parameter or in the Load type parameter) connected to the same bus, the Load Flow tool determines the resulting bus type (swing, PQ, or PV). The table shows how the bus types are determined for some of the model buses of the power_13NodeTestFeeder example.

Bus | Load Flow Blocks | Resulting Bus Type |
---|---|---|

| 4160 V swing | 632_a=swing V=1.0210 pu -2.49 deg. (Voltages and angles are specified in the ‘632’ Load Flow Bus block) |

| No load flow block | PQ |

| 634 Yg PQ load block | PQ |

| 646_Z load block | PQ (Constant Z loads are included in the Ybus admittance matrix.) |

| 675 Yg PQ load 675 Yg Z load | PQ (Constant Z loads are included in the Ybus admittance matrix.) |

Some restrictions apply when you have several source blocks and synchronous machines connected to the same load flow bus:

You cannot connect two swing generators in parallel.

You cannot connect a swing generator in parallel with a PV ideal voltage source

You can connect only one PV generator with finite Q limits at a generation bus. However, you can have other PQ generators and loads connected on the same bus.

For more information on how to use the Load Flow Bus block in your model, see Load Flow Bus block.

**Open the Load Flow Tool to Perform Load Flow Analysis. **Open the Load Flow tool by clicking the **Load Flow** button
in the powergui block. The tool displays a list of
the individual single-phase buses (one bus per phase) found in the
power_13NodeTestFeeder model. In the Load Flow tool, the load flow
has not yet been performed, and the V_LF and Vangle_LF columns display
zero values.

The load flow parameters in the **Preferences** tab
of the Powergui are used to build the Ybus network admittance matrix
and to solve the load flow. The base power is used to specify units
of the normalized Ybus matrix in pu/Pbase and bus base voltages. The `power_13NodeTestFeeder`

model
contains 29 single phase buses; consequently, the Ybus matrix is a
29x29 complex matrix evaluated at the frequency specified by the **Frequency
(Hz)** parameter.

The load flow algorithm uses an iterative solution based on
the Newton-Raphson method. The **Max iterations** parameter
defines the maximum number of iterations. The load flow algorithm
iterates until the P and Q mismatch at each bus is lower than the **PQ
tolerance** parameter (in pu/Pbase). The power mismatch is
defined as the difference between the net power injected into the
bus by generators and PQ loads and the power transmitted on all links
leaving that bus.

To avoid a badly conditioned Ybus matrix, select the **Base
power** parameter value in the range of nominal powers and
loads connected to the network. For a transmission network with voltages
ranging from 120 kV to 765 kV, a 100 MVA base is usually selected.
For a distribution network with loads having a nominal power in the
range of tens to hundreds of kVA, a 100 kVA to 1 MVA power base is
better adapted.

To solve the load flow, click **Compute**.
The bus voltages and angles then appear in the V_LF and Vangle_LF
columns of the table.

To display the load flow report showing the power flow at each
bus, click **Report**. You can also save this report
in a file by specifying the file name at the prompt.

The report starts with displaying the summary of active and reactive powers, showing total PQ sharing between generators (SM- and Vsrc-type blocks), PQ loads (PQ-type RLC loads, dynamic loads, and asynchronous machine loads), shunt constant Z loads (Z-type RLC loads and magnetizing branches of transformers):

SUMMARY for subnetwork No 1 Total generation : P= 3518.74 kW Q= 1540.14 kvar Total PQ load : P= 3101.90 kW Q= 1880.42 kvar Total Zshunt load : P= 363.47 kW Q= -479.42 kvar Total losses : P= 53.36 kW Q= 139.14 kvar

The `Total losses`

line represents the difference
between generation and loads (PQ type + Zshunt type). It therefore
represents series losses. After this summary, a voltage and power
report appears for each bus.For each phase of every bus, the bus voltage
and angle are listed on the first line. The next three lines give
the PQ generated at the bus (all SM and voltage sources), the PQ absorbed
by the PQ type loads, and the PQ absorbed by the Z-type loads. The
last lines, preceded by an arrow (–>), list the PQ power
transmitted on all links leaving that bus.

The last column gives the positive-sequence bus voltage V1 (magnitude and angle, for three-phase buses only) and the sum of PQ powers for all phases (PQ generated by sources, PQ absorbed by loads, and PQ transmitted through transformers, lines, and series impedances). For example, you can verify that the total PQ load absorbed at bus 634 (P = 400 kW Q = 290 kvar) corresponds to the sum of active and reactive powers specified for phases A, B, and C in the load block.

**Apply the Load Flow Solution to Your Model. **When performing a load flow analysis, you might need to try
different P, Q, and V values until you find satisfactory voltages
at all buses. This can require, for example, changing generated power,
load powers, or reactive shunt compensation.

To change the load flow setup, you need to edit the parameters
of the load flow blocks and of the Load Flow Bus blocks.
Then, click **Update** to refresh the load flow
data displayed by the table. Click **Compute** to
get a new load flow solution corresponding to the changes you made.

Once you have a satisfactory load flow, you need to update the
model initial conditions according to the load flow solution. Click **Apply
to Model** to initialize the PQ-type load blocks, the source
block internal voltages, the machine blocks, as well as the initial
conditions of associated regulators.

Open the Three-Phase Series RLC Load block connected
at bus 632. As the **Load type** specified in the **Load
Flow** tab is constant PQ, the vector of **Nominal
phase-to-neutral voltages [Va Vb Vc]** of this block has
been changed to the corresponding bus voltages ```
[1.021 1.042
1.0174]*2401.78
```

Vrms . Open the Three-Phase Source block
connected at bus 632. The **Line-to neutral voltages [Va Vb
Vc]** parameter is also set to `[1.021 1.042 1.0174]*2401.78`

Vrms.

Open the Power Flow Results subsystem and start the simulation.

Observe voltage magnitudes and PQ powers on various Display blocks. These values correspond to values displayed in the load flow report.

As an alternative to using the Load Flow tool interface to perform
a load flow, you can use the tool at the command line. For example,
to perform the positive-sequence load flow on the `power_LFnetwork_5bus`

model,
enter:

LF = power_loadflow('-v2','power_LFnetwork_5bus','solve')

LF = model: 'power_LFnetwork_5bus' frequency: 60 basePower: 100000000 tolerance: 0.0001 Ybus1: [5x5 double] bus: [1x7 struct] sm: [1x1 struct] asm: [1x1 struct] vsrc: [1x1 struct] pqload: [1x1 struct] rlcload: [1x2 struct] Networks: [1x1 struct] status: 1 iterations: 2 error: '' LoadFlowSolver: 'PositiveSequence'

The `power_loadflow`

function returns the
solution in the LF structure, and the model is initialized to start
in steady state. You can obtain a detailed load flow report by entering:

LF = power_loadflow('-v2','power_LFnetwork_5bus','solve','report');

The function prompts you to save the report in a file that is
displayed in the MATLAB^{®} editor.

You can use the same command to perform an unbalanced load
flow on the `power_13NodeTestFeeder`

model:

LF = power_loadflow('-v2','power_13NodeTestFeeder','solve')

LF = model: 'power_13NodeTestFeeder' frequency: 60 basePower: 100000 tolerance: 0.0001 Ybus: [29x29 double] bus: [1x29 struct] sm: [1x1 struct] asm: [1x1 struct] vsrc: [1x1 struct] pqload: [1x1 struct] rlcload: [1x1 struct] Networks: [1x1 struct] status: 1 iterations: 3 error: '' LoadFlowSolver: 'Unbalanced'

For more information on how to use the `power_loadflow`

function
in your code and for detailed information on the LF structure, see `power_loadflow`

.

Up to now, you have simulated a relatively simple power system consisting of a maximum of three machines. If you increase complexity of your network by adding extra lines, loads, transformers, and machines, the required simulation time becomes longer and 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, implying simulation times of minutes and even hours. The conventional continuous or discrete solution method is therefore not practical for stability studies involving low-frequency oscillation modes. To allow such studies, you have to use the phasor technique (see Introducing the Phasor Simulation Method).

For a stability study, we are not interested in the fast oscillation modes resulting from the
interaction of linear R, L, C elements and distributed parameter lines. These oscillation
modes, which are usually located above the fundamental frequency of 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's differential equations by 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 (current
injected by machines into the network) 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, thus dramatically reducing the required 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`

. The continuous phasor solution uses a
Simulink^{®} variable-step solver. Continuous variable-step solvers are very efficient in
solving this type of problem. Recommended solver is `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. The `Discrete phasor`

simulation method allows you to use Simulink
Coder™ to generate code and simulate your model in real time.

Now apply the phasor solution method to the two-machine system
you have just simulated with the conventional method. Open the `power_machines`

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. Note that the words `Phasor 60 Hz`

now appear on the Powergui icon, indicating that this new method is used to simulate your
circuit. To start the simulation in steady state, you must first repeat the machine
initialization procedure by using either the Machine Initialization Tool or the Load Flow Tool.

Observe that simulation is now much faster. The results compare well with those obtained with the continuous mode simulation.

You may also try the discrete phasor simulation. In the powergui block,
set **Simulation type** to `Discrete phasor`

and
specify a sample time of `4e-3`

sec.

The synchronous machine waveforms are compared on the following figure for three simulation types:

Continuous (yellow)

Phasor (continuous) (cyan)

Discrete phasor with a 4 ms sample time (magenta)

Both phasor models (continuous and discrete) compare well with the continuous model.

Contrary to the continuous phasor solver, which uses a full set of machine differential equations for modelling stator and rotor transients, the discrete phasor solver uses simplified machine models where differential equations on the stator side are replaced with algebraic equations. These lower-order machine models eliminate two states (phid and phiq stator fluxes) and produce simulation results similar to commercial stability software. Compared with the continuous phasor solver, the discrete phasor solver produces "cleaner" waveforms. For this example, you can observe that in the discrete phasor model, the speed (w) and terminal voltage (Vt) high-frequency oscillations are eliminated and the Vt voltage glitch observed at the breaker opening is also eliminated.

The discrete phasor solver has also two additional advantages:

This solver uses a robust solution method, which allows you to eliminate machine parasitic loads.

This solver allows you to use Simulink Coder to generate code and simulate your model in real time.

**Note**

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. If you want to simulate
this model in real time, the whole model must use fixed-time steps. You therefore need to
change the variable-step solver to a fixed-step solver that uses the same sample time as
the electric network.

**Comparison of Results for Continuous and Phasor
Simulation Methods**

The phasor solution method is illustrated on more complex networks presented as the following examples:

Transient stability of two machines with power system stabilizers (PSS) and a static var compensator (SVC) (

`power_svc_pss`

model)Performance of three power system stabilizers for interarea oscillations (

`power_PSS`

model)

The first example illustrates the impact of PSS and use of a SVC to stabilize a two-machine system. The second example compares the performance of three different types of power system stabilizers on a four-machine, two-area system.

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