Simscape™ Electrical™ can perform a powerflow, or loadflow, analysis for an AC electrical power transmission system modeled using the Simscape threephase electrical domain. A loadflow analysis allows you to determine the voltage magnitudes, voltage phase angles, active power, and reactive power of the electrical system in steadystate operation.
For a given steadystate operating point, the loadflow data reveals the:
Voltage magnitude and voltage phase angle at each bus
Active and reactive power generation for each generator that supplies the grid
Active and reactive power that flows to each load that places demand on the grid
You can use the data to determine ideal operating conditions or estimate the response of your system to hypothetical situations. For example, if you know the active and reactive power in each transmission line, you can determine if the remaining lines can handle the extra load that occurs when one or more transmission lines go offline.
You can also use the data to calculate transmission line or system losses and examine the overall voltage profile of the network. Investigating these attributes can help you determine if the system needs reactive compensation to overcome low voltage levels.
To determine the steadystate loadflow solution for a threephase network using Simscape Electrical, your model must be:
Compatible with and configured for the Simscape frequency and time simulation mode. For more information, see Frequency and Time Simulation Mode (Simscape) and Solver Configuration.
Load balanced. The level of approximation of the loadflow analysis depends on how balanced the system is and the level of harmonics that are present.
Enabled for Simscape data logging. For complex models or long simulation runs, you can improve simulation performance by enabling data logging for selected blocks by using local solver settings. For a loadflow analysis, data logging is required only for Busbar blocks. For more information, see Enable Data Logging for the Whole Model (Simscape) and Log Data for Selected Blocks Only (Simscape).
In an electrical transmission system, a bus bar connector, or bus, is a vertical line that connects power components such as generators, loads, and transformers. To represent buses, the Simscape > Electrical > Connectors & References library provides the Busbar block.
You need to select the right threephase voltage source for your model to conduct a loadflow analysis. Which source you choose depends on whether you want to prioritize simulation accuracy or performance. The balance between simulation accuracy and performance depends, in part, on the blocks that you use to represent the voltage sources in your analysis model. Simulation accuracy is a measure of model fidelity, that is, how closely the simulation results agree with mathematical and empirical models. As model fidelity increases, so does the computational cost of simulation. As computational cost increases, simulation speed, decreases. Conversely, as model fidelity decreases, simulation speed increases.
Prioritize Model Fidelity by Using Machine Blocks. To prioritize model fidelity over simulation speed, represent voltage sources by using induction or synchronous machine blocks. For modeling induction machines, the Simscape > Electrical > Electromechanical > Asynchronous Machines library provides both the Induction Machine Squirrel Cage and Induction Machine Wound Rotor blocks. For modeling synchronous machines, the Simscape > Electrical > Electromechanical > Synchronous Machines library provides both the library contains the Synchronous Machine Model 2.1, Synchronous Machine Round Rotor, and Synchronous Machine Salient Pole blocks.
Prioritize Simulation Speed by Using Load Flow Source Blocks. For a faster simulating, but lower fidelity model, represent the voltage sources in your analysis model by using a Load Flow Source block from the Simscape > Electrical > Sources library. The Load Flow Source block supplies either an idealized or a currentdependent voltage source. The voltage can contain series impedance or can act as a source for a swing, PV, or PQ bus.
To examine loadflow data for a threephase Simscape Electrical transmission system model that is compatible with frequencytime simulation mode:
Enable Simscape data logging.
Parameterize the voltage sources.
At the beginning of a loadflow analysis, the equation variables for transmission line losses are unknown. While the unknown variables are being solved, the buses balance the losses by providing or absorbing active and reactive power. For each bus there are four variables:
P — Active power
Q — Reactive power
V — Voltage
θ — Phase angle
Two of the variables are known and two are unknown. Which variables are known and which are unknown depends on the actively controlled threephase sources and loads that are connected to the bus bar. The voltage source block configurations determine which bus types are used in loadflow analysis. You can include more than one bus type in your model. Bus type options are:
Swing bus — A swing, slack, or reference, bus balances the active and
reactive power in a system. The slack bus serves as an angular reference for other
buses in the system. The phase angle of a swing bus is 0° and the voltage
magnitude is specified. A typical value is 1
pu
. At the beginning of the loadflow analysis,
P and Q are the unknown variables for this
bus.
PV bus — A PV (or generator) bus balances the active and reactive power in a system by supplying a constant, active power and voltage. At the beginning of the loadflow analysis, θ and Q are the unknown variables for this bus.
PQ bus — A PQ (or load) bus determines the amount of active and reactive power that is consumed. At the beginning of the loadflow analysis, V and θ are the unknown variables for this bus.
If your model contains one or more:
Load Flow Source blocks — For each block, for the Source type parameter, set the bus type to one of these options:
Swing bus
PV bus
PQ bus
Specify the related parameters, which differ depending on which bus type you choose.
To avoid a simulation issue due to a nonoptimal minimum for PV or PQ buses, in the Expected Ranges settings, specify minimum and maximum values for the Internal source phase search range parameter.
Induction machine blocks — For each block, specify the priority and beginning
values for the block using the Variables settings. In the
Main settings, set the Initialization
option parameter to Set targets for load flow
variables
. In the Variables settings, select
a Priority and specify a Beginning Value for:
Slip
Real power generated
Mechanical power consumed
For more on information on setting initial target values by using the Variables settings, see Set Priority and Initial Target for Block Variables (Simscape).
To fully specify the initial condition, you
must include an initialization constraint in the form of a highpriority target
value. For example, if your induction machine is connected to an Inertia block, the initial
condition for the induction machine is completely specified if, in the
Variables settings of the Inertia block, the
Priority for Rotational velocity is
set to High
. Alternatively, you could set the
Priority to None
for the
Inertia block
Rotational velocity, and instead set the
Priority for the induction machine block
Slip, Real power generated, or
Mechanical power consumed to
High
.
Synchronous machine blocks — For each block, specify the bus type and beginning values using the Initial Conditions settings. The available parameter targets depend on whether the block is configured for a swing, PV, or PQ bus. In the Initial Conditions settings:
Set the Initialization option parameter to
Set targets for load flow variables
.
Select a bus for the Source type parameter.
Specify values for the related bus parameter.
To avoid a simulation issue due to a nonoptimal minimum, in the Expected ranges settings, specify minimum and maximum values for the Internal source phase search range parameter.
Configure each Busbar block:
Set the Number of connections to
2
, 3
, or
4
.
Specify the voltage and frequency to match the specified values of the connected voltage source block.
To view the loadflow data using a Scope block, expose the optional measurement ports on the Busbar block:
To expose ports Vt and ph, set
Measurement ports to
Yes
.
To expose ports P and Q, set
Measurement ports to
Yes
.
Connect the Busbar and Scope blocks.
Configure the Solver Configuration block. Set
Equation formulation to Frequency and
time
.
Simulate the model.
After simulating, you can view the loadflow results in the Busbar block annotation and in the Simscape logging data that the model outputs to the MATLAB^{®} workspace.
For examples that show how to perform a loadflow analysis, see:
You can use the data from your loadflow analysis to correctly initialize threephase induction and synchronous machine blocks. For examples, see:
If your model is configured for a powerflow analysis, you can also use the LoadFlow Analyzer to perform a powerflow, or loadflow, analysis for a threephase AC electrical power transmission system. The tool generates two tables. The app generates two tables. One of the tables contains data for the network nodes, as represented by Busbar, Load Flow Source, synchronous machine, induction machine, and threephase load blocks. The other table contains data for the network connections, as represented by transmission lines, cable, and transformer blocks. When you open the tool, the tables are preloaded with the specified parameter values for the relevant blocks in the current or specified model. After you run the powerflow analysis, the tables also display the steadystate voltage magnitudes, voltage phase angles, active power, and reactive power for the node and connection blocks.
The LoadFlow Analyzer app allows you to:
Run a loadflow analysis.
Highlight and update loadflow input block parameter values for busbar, load flow source, synchronous machine, induction machine, and threephase load blocks.
Change the bus type of load flow source, synchronous machine, and induction machine blocks.
Select and highlight node and connection blocks in the model.
Sort columns in the tables by increasing or decreasing values.
Export the data to a spreadsheet, a MATfile, or commaseparated variable (CSV) files.
If you encounter issues when simulating a loadflow model, apply these troubleshooting measures. Testing your loadflow model incrementally can help you avoid specifying nonphysical loadflow requirements.
Including internal source impedance for a Load Flow
Source block when the Source type parameter of the
block is set to Swing bus
, PV bus
, or
PQ bus
can prevent initialization convergence. To resolve any
convergence issues, use one of these methods:
Limit the solution range by specifying a value for the Internal source phase search range parameter.
Neglect source impedance.
Model the impedance externally from the Load Flow Source block.
If you initialize a synchronous machine block for a loadflow analysis, the block solves all Parktransformed flux variables and mechanical variables for steady state. However, incorrect initialization of an automatic voltage regulator (AVR) or governor can result in a fieldcircuit transient or an initial rotor acceleration. To resolve these issues:
Determine the initialization values for the torque and field voltage.
Run the loadflow analysis by using approximated values for the AVR and governor and settings.
Make a note of these values in the loadflow results reported by the adjacent Busbar block:
Voltage magnitude
Phase angle
Generated real power
Generated reactive power
For the synchronous machine block, in the Initial
Conditions settings, set the Initialization
option parameter to Set real power, reactive power,
terminal voltage, and terminal phase
.
Specify these parameters using the values from the load flow results:
Terminal voltage magnitude
Terminal voltage angle
Terminal active power
Terminal reactive power
Print the required initial conditions for the AVR and governor to the MATLAB workspace. Rightclick the machine block and, from the context menu, select Electrical > Display Associated Initial Conditions. The relevant data are the field circuit voltage, si_efd0, and the mechanical torque, si_torque0.
Specify the AVR and governor initial conditions using the calculated initial condition values.
For example, the table shows the annotated data for the
Busbar block that is next to the Synchronous
Machine Salient Pole block in
ee_loadflow_sm_initialization
, the model for the Synchronous Machine Initialization with Loadflow example. If you
open the Synchronous Machine Salient Pole block, click the
Initial Conditions settings, and set the Initialization
option parameter to Set real power, reactive power, terminal
voltage, and terminal phase
, you can observe that the specified parameter
values are equal to the loadflow simulation values.
The specified parameter values have already been entered to match the load flow results for this model.
Physical Quantity  LoadFlow Simulation Value  Synchronous Machine Block Initial Conditions Parameter Name  Synchronous Machine Block Initial Conditions Parameter Value 

Voltage magnitude  1.020 pu  Terminal voltage magnitude 

Phase angle  0.00 deg  Terminal voltage angle 

Generated real power  31.2 MW  Terminal active power 

Generated reactive power  10.4 Mvar  Terminal reactive power 

If you print the data to the command line, the si_torque0 and
si_efd0 data are printed under the Initial conditions required
for steadystate
(SI)
:
Initial conditions required for steadystate (SI): si_efd0 = 85.4468 : V % Field circuit voltage si_ifd0 = 1168.87 : A % Field circuit current si_torque0 = 828709 : Nm % Mechanical torque si_Pm0 = 3.12416e+07 : W % Mechanical power
To initialize correctly, specify 85.4468
V
as the value for the field voltage source, and
828709
Nm
as the value for the Shaft torque
Constant block that is connected to the Ideal
Torque Source block.
There are often multiple solutions to the set of loadflow targets specified when initializing an AC electrical network. For example, for a PV bus source where you specify the active power and voltage, there are two solutions for the reactive power. For the desired solution, the magnitude of the reactive power is typically less than the specified active power magnitude. For the undesired solution, the reactive power magnitude is much larger than the active power magnitude.
If the initialization returns the undesired solution, reconfigure the Load Flow Source or synchronous machine block and increase the value for the minimum boundary of the Internal source range search range parameter. For the Load Flow Source block, the parameter is in the Expected Ranges settings. For synchronous machine blocks, the parameter is in the Initial Conditions settings.
The simulation can stop and generate an error if, to satisfy the active and reactive power demands, the optimization decreases the Busbar block voltage, to the point where the solution is closer to an undesired local minimum around zero busbar voltage than to the desired load flow solution. To prevent this type of issue, reconfigure the Load Flow Source or synchronous machine blocks and increase the value of the Minimum voltage (pu) parameter. For the Load Flow Source block, the parameter is in the Expected Ranges settings. For synchronous machine blocks, the parameter is in the Initial Conditions settings.
You can only perform a loadflow analysis by using the frequency and time simulation mode. Replace any blocks that are not compatible with the frequency and time simulation mode. For more information, see Frequency and Time Simulation Mode (Simscape).