Main Content

Perform a Load-Flow Analysis Using Simscape Electrical

Simscape™ Electrical™ can perform a power-flow, or load-flow, analysis for an AC, DC, or mixed AC and DC electrical power transmission system modeled using the Simscape three-phase electrical domain. A load-flow analysis allows you to determine the voltage magnitudes, voltage phase angles, active power, and reactive power of the electrical system in steady-state operation.

For a given steady-state operating point, the load-flow 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 power compensation to overcome low voltage levels.

Network Requirements for a Simscape Electrical Load-Flow Analysis

To determine the steady-state load-flow solution for a three-phase 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 and Solver Configuration.

  • Load balanced. The level of approximation of the load-flow 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 load-flow analysis, data logging is required only for Busbar blocks. For more information, see Enable Simscape Data Logging for the Whole Model and Log Data for Selected Blocks Only.

Essential Blocks for a Load-Flow Analysis

Bus Bar Connectors

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 and Busbar (DC) blocks.

Three-Phase Voltage Sources

You need to select the right three-phase voltage source for your model to conduct a load-flow 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 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 current-dependent voltage source. The voltage can contain series impedance or can act as a source for a swing, PV, or PQ bus.

Performing a Load-Flow Analysis

To examine load-flow data for a three-phase Simscape Electrical transmission system model that is compatible with frequency-time simulation mode:

  1. Enable Simscape data logging.

  2. Parameterize the voltage sources.

    At the beginning of a load-flow 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 three-phase sources and loads that are connected to the bus bar. The voltage source block configurations determine which bus types are used in load-flow 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 load-flow 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 load-flow 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 load-flow 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.

      To fully specify the initial condition, you must include an initialization constraint in the form of a high-priority 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:

      1. Set the Initialization option parameter to Set targets for load flow variables.

      2. Select a bus for the Source type parameter.

      3. Specify values for the related bus parameter.

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

  3. Configure each Busbar and Busbar (DC) block:

    1. Set the Number of connections to 2, 3, or 4.

    2. In the Busbar blocks, specify the voltage and frequency to match the specified values of the connected blocks. In the Busbar (DC) blocks, you only need to specify the rated DC voltage.

    3. To view the load-flow 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.

  4. Configure the Solver Configuration block. Set Equation formulation to Frequency and time.

  5. Simulate the model.

After simulating, you can view the load-flow results in the Busbar and Busbar (DC) blocks annotation and in the Simscape logging data that the model outputs to the MATLAB® workspace.

For examples that show how to perform a load-flow analysis, see:

Machine Parameterization and Variable Initialization

You can use the data from your load-flow analysis to correctly initialize three-phase induction and synchronous machine blocks. For examples, see:

Load-Flow Analyzer App

If your model is configured for a power-flow analysis, you can also use the Load-Flow Analyzer to perform a power-flow, or load-flow, analysis for a three-phase AC or DC electrical power transmission system. The app generates three tables. The AC Nodes table contains data for the AC network nodes, as represented by AC busbar, load flow source, synchronous machine, induction machine, and three-phase load blocks. The AC & DC Busbars table contains data for all busbars. The AC Connections table contains data for the network connections, as represented by transmission line and transformer blocks. When you open the app, the tables are preloaded with the specified parameter values for the relevant blocks in the current or specified model. After you run the power-flow analysis, the tables also display the steady-state voltage magnitudes, voltage phase angles, active power, and reactive power for the node and connection blocks.

The Load-Flow Analyzer app allows you to:

  • Run a load-flow analysis.

  • Highlight and update load-flow input block parameter values for busbar, load flow source, synchronous machine, induction machine, and three-phase 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 MAT-file, or comma-separated variable (CSV) files.

Troubleshooting Load-Flow Analysis and Initialization Issues

If you encounter issues when simulating a load-flow model, apply these troubleshooting measures. Testing your load-flow model incrementally can help you avoid specifying nonphysical load-flow requirements.

Internal Load-Flow Source Impedance

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.

Field-Circuit Transient or Initial Rotor Acceleration

If you initialize a synchronous machine block for a load-flow analysis, the block solves all Park-transformed flux variables and mechanical variables for steady state. However, incorrect initialization of an automatic voltage regulator (AVR) or governor can result in a field-circuit transient or an initial rotor acceleration. To resolve these issues:

  1. Determine the initialization values for the torque and field voltage.

    1. Run the load-flow analysis by using approximated values for the AVR and governor and settings.

    2. Make a note of these values in the load-flow results reported by the adjacent Busbar block:

      • Voltage magnitude

      • Phase angle

      • Generated real power

      • Generated reactive power

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

    4. Specify these parameters using the values from the load flow results:

      • Terminal voltage magnitude

      • Terminal voltage angle

      • Terminal active power

      • Terminal reactive power

    5. Print the required initial conditions for the AVR and governor to the MATLAB workspace. Right-click 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.

  2. 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 LoadflowSMInitialization, 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 load-flow simulation values.

Note

The specified parameter values have already been entered to match the load flow results for this model.

Physical QuantityLoad-Flow Simulation ValueSynchronous Machine Block Initial Conditions Parameter NameSynchronous Machine Block Initial Conditions Parameter Value
Voltage magnitude1.020 puTerminal voltage magnitude

13.8*1.02 kV

Phase angle0.00 degTerminal voltage angle

0 deg

Generated real power31.2 MWTerminal active power

31.2e6 V*A

Generated reactive power10.4 MvarTerminal reactive power

10.4e6 V*A

If you print the data to the command line, the si_torque0 and si_efd0 data are printed under the Initial conditions required for steady-state (SI):

Initial conditions required for steady-state (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.

Multiple Load-Flow Simulation Solutions

There are often multiple solutions to the set of load-flow 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.

Nonoptimal Local Minimum

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.

Frequency and Time Simulation Mode Incompatibility

You can only perform a load-flow 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.

See Also

Simscape Blocks

Apps

Related Topics