Main Content

Perform positive-sequence load flow or unbalanced load flow. Initialize models containing three-phase machines and dynamic load blocks

`power_loadflow('-v2',sys)`

power_loadflow('-v2',sys,'AddBuses')

LF = power_loadflow('-v2',sys)

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

LF = power_loadflow('-v2',sys,'noupdate')

LF = power_loadflow('-v2',sys,'solve','report')

LF = power_loadflow('-v2',sys,'solve','report',fname)

LF = power_loadflow('-v2',sys,'solve','ExcelReport',fname)

power_loadflow(sys)

Mparam = power_loadflow(sys)

MI = power_loadflow(sys,Mparam)

The `power_loadflow`

function contains two
different tools for performing load flow and initializing three-phase
models with machines.

The Load Flow tool uses the Newton-Raphson method to provide a robust and fast convergence solution. It offers most of the functionality of other load flow software available in the power utility industry.

The `-v2`

option in `power_loadflow`

function
syntax allows you to access this tool from the command line.

`power_loadflow('-v2',sys)`

opens a graphical
user interface to edit and perform load flow of `sys`

using
the Newton Raphson algorithm.

`power_loadflow('-v2',sys,'AddBuses')`

adds Load
Flow Bus blocks to the model `sys`

. The added
blocks are single-connector Load Flow Bus blocks, which
specify bus parameters for a positive-sequence load flow.

`LF = power_loadflow('-v2',sys)`

returns
the current load flow parameters of `sys`

.

`LF = power_loadflow('-v2',sys,'solve')`

computes
the load flow of `sys`

. The model is initialized
with the load flow solution.

`LF = power_loadflow('-v2',sys,'noupdate')`

computes
the load flow but does not initialize the model with the load flow
solution.

`LF = power_loadflow('-v2',sys,'solve','report')`

computes
the load flow and then opens the editor to save the load flow report.

`LF = power_loadflow('-v2',sys,'solve','report',fname)`

computes
the load flow and then saves detailed information in `fname`

file.

`LF = power_loadflow('-v2',sys,'solve','ExcelReport',fname)`

computes
the load flow and then saves detailed information in the `fname`

Excel^{®} file.
This capability is available only for the positive-sequence load flow.

The Machine Initialization tool offers simplified load flow features to initialize the machine initial currents of your models.

`power_loadflow(sys)`

opens the Machine Initialization
tool dialog box to perform machine initialization.

`Mparam = power_loadflow(sys)`

returns the
machine initialization parameter values of `sys`

.
Use `Mparam`

as a template variable to perform new
machine initialization.

`MI = power_loadflow(sys,Mparam)`

computes
the machine initial conditions using the load flow parameters given
in `Mparam`

. Create an instance of `Mparam`

using ```
Mparam
= power_loadflow(sys)
```

, and then edit the initialization
parameter values based on this template.

Open this dialog box by entering the ```
power_loadflow('-v2',
sys)
```

command, or from the Powergui block dialog box by selecting **Load Flow**.

**Update**Click to get the latest changes in the model. Any previous load flow solution is cleared from the table.

**Add bus blocks**Click to add load flow bus blocks to the model. The

`power_loadflow`

function determines the load flow bus required for your model and adds load flow bus blocks only in places where there is no load flow bus block already connected.**Compute**Click to solve the load flow. The solution is displayed in the

`V_LF`

,`Vangle_LF`

,`P_LF`

, and`Q_LF`

columns of the Load Flow tool table. The load flow is performed at the frequency, base power, PQ tolerance, and max iterations specified in the**Preference**tab of the Powergui block.**Apply to Model**Click to apply the load flow solution to the model.

**Report**Click to save in Excel or MATLAB

^{®}format a load flow report showing power flowing toward each bus.**Close**Close the Load Flow tool.

The Load flow parameters and solution are returned in a structure with the following fields.

Field | Description |
---|---|

`model` | The name of the model. |

`frequency` | The load flow frequency, in hertz. This value corresponds to
the Load flow frequency parameter of the Powergui
block. |

`basePower` | The base power used by the Load Flow tool. This value corresponds
to the Base power Pbase parameter of the Powergui
block. |

`tolerance` | The tolerance used by the Load Flow tool. This value corresponds
to the PQ Tolerance parameter of the Powergui
block. |

`bus` | `[1 x Nbus]` structure with fields defining
the bus parameters. For a positive-sequence load flow, `Nbus` is
the number of three-phase buses in the model. For an unbalanced load
flow, `Nbus` is the total number of single-phase
buses in the model. |

`sm` | `[1 x Nsm]` structure with fields defining
the load flow parameters of the Synchronous Machine blocks. `Nsm` is
the number of Synchronous Machine blocks in the model. |

`asm` | `[1 x Nasm]` structure with fields defining
the load flow parameters of the Asynchronous Machine blocks. `Nasm` is
the number of Asynchronous Machine blocks in the model. |

`vsrc` | `[1 x Nsrc]` structure with fields defining
the load flow parameters of the Three-Phase Source, Three-Phase
Programmable Voltage Source, and AC Voltage Source blocks. `Nsrc` is
the number of single-phase and three-phase voltage source blocks in
the model. |

`pqload` | `[1 x Npq]` structure with fields defining
the load flow parameters of the Three-Phase Dynamic Load blocks. `Npq` is
the number of Three-Phase Dynamic Load blocks in the model. |

`rlcload` | `[1 x Nrlc]` structure with fields defining
the load flow parameters of the Three-Phase Parallel RLC Load, Three-Phase
Series RLC Load, Parallel RLC Load, and Series
RLC Load blocks. `Nrlc` is the number of
three-phase and single-phase blocks in the model. |

`Ybus1` | `[Nbus x Nbus]` positive-sequence complex
admittance matrix in pu/Pbase used for positive-sequence load flow
solution. |

`Ybus` | `[Nbus x Nbus]` complex admittance matrix
in pu/Pbase used for unbalanced load flow solution. |

`Networks` | Lists the bus numbers of each independent network. |

`status` | Returns `1` when a solution is found, and `-1` when
no solution is found. |

`iterations` | The number of iterations that the solver took to solve the load flow. |

`error` | Displays an error message when no solution is found. |

`LoadFlowSolver` | The type of load flow solver: `'PositiveSequence'` or `'Unbalanced'` |

You can open this dialog box by entering the `power_loadflow(sys)`

command,
or from the Powergui block dialog box by selecting **Machine
Initialization**.

**Machines info**Displays the names of the Simplified Synchronous Machines, the Synchronous Machines, the Asynchronous Machine, and the Three-Phase Dynamic Load blocks of your model. Select a machine or a load in the list box to set its parameters.

**Bus type**If

**Bus type**is set to`P&V Generator`

, you can set the terminal voltage and active power of the machine. If**Bus type**is set to`PQ generator`

, you can set the active and reactive powers. If**Bus type**is set to`Swing Bus`

, you can set the terminal voltage, enter an active power guess, and specify the phase of the UAN terminal voltage of the machine.If you select an Asynchronous Machine block machine, you have to enter only the mechanical power delivered by the machine. If you select a Three-Phase Dynamic Load block, you must specify the active and reactive powers consumed by the load.

**Terminal voltage UAB**Specify the terminal line-to-line voltage of the selected machine.

**Active power**Specify the active power of the selected machine or load.

**Active power guess**Specify an active power guess to start iterations when the specified machine bus type is

`Swing Bus`

.**Reactive power**Specify the reactive power of the selected machine or load.

**Phase of UAN voltage**This parameter is activated only when the bus type is

`Swing Bus`

.Specify the phase of the phase-to-neutral voltage of phase A of the selected machine.

**Mechanical power**In motor mode, specify the mechanical power developed by the squirrel cage induction machine. In generator mode, specify the mechanical power absorbed by the machine as a negative number.

**Machine initialization frequency**Specify the frequency to be used in the calculations (normally 60 Hz or 50 Hz).

**Initial condition**Normally, you keep the default setting

**Auto**to let the tool automatically adjust the initial conditions before starting iterations. If you select**Start from previous solution**, the tool starts with initial conditions corresponding to the previous solution. Try this option if the load flow fails to converge after a change has been made to the power and voltage settings of the machines or to the circuit parameters.**Update Machine list**Update the list of machines, voltage and current phasors, as well as the powers, if you have made a change in your model while the Machine Initialization tool is open. The new voltages and powers displayed are computed by using the machine currents obtained from the last computation (the three currents stored in the

**Initial conditions**parameter of the machine blocks).**Compute and Apply**Executes the calculations for the given machine parameters.

The Machine Initialization parameters of a model are organized in a structure with the following fields.

Field | Description |
---|---|

`name` | Cell array of character vectors, each of which contains the name of a machine block in the model. |

`type` | Cell array of character vectors (`'Asynchronous Machine'` , ```
'Simplified
Synchronous Machine'
``` , `'Synchronous Machine'` , ```
'Three
Phase Dynamic Load'
``` ) defining the mask type of the machine
and load blocks. |

`set` | Structure with variable fields defining the parameters specific to each machine or dynamic load (Bus Type, Terminal Voltage, Active Power, Reactive Power, Mechanical Power). |

`LoadFlowFrequency` | Parameter defining the frequency used by the tool, in hertz. The frequency is specified only in the first element of the Machine Initialization parameters structure. |

`InitialConditions` | Character vector that defines the initial condition type (`'Auto'` ,```
'Start
from previous solution'
``` ). The initial condition status is
specified only in the first element of the Machine Initialization
parameter structure. |

`DisplayWarnings` | Character vector (`'on'` ,`'off'` )
controlling the display of warning messages during the Machine Initialization
computation. |

For example, you obtain the initialization parameters for the `power_machines`

example
by doing:

Mparam = power_loadflow('power_machines'); Mparam(1) ans = name: 'SM 3.125 MVA' type: 'Synchronous Machine' set: [1x1 struct] LoadFlowFrequency: 60 InitialConditions: 'Auto' DisplayWarnings: 'on' lfparam(2) name: 'ASM 2250HP' type: 'Asynchronous Machine' set: [1x1 struct] LoadFlowFrequency: [] InitialConditions: [] DisplayWarnings: []

If you use the `Mparam = power_loadflow(sys)`

command
to create the initialization parameters structure, you do not need
to edit or modify the name and type fields of `lfparam`

.
The `set`

field is where you specify new parameter
values, `lfparam(1).LoadFlowFrequency`

is where you
define the frequency. `lfparam(1).Initialconditions`

is
where you specify the initial conditions status.

If your model does not contain any Asynchronous, Simplified
Synchronous, or Synchronous Machine blocks and no Three Phase Dynamic
Load block, `lfparam`

returns an empty variable.

For the Asynchronous Machine blocks you can specify only the
mechanical power of the machine. The `set`

field
is a structure with the following field.

Field | Description |
---|---|

`MechanicalPower` | The mechanical power, in watts, of the machine. |

For example, the mechanical power of the Asynchronous Machine
in the `power_machines`

example is:

Mparam = power_loadflow('power_machines'); Mparam(2).set ans = MechanicalPower: 1492000

For the Simplified Synchronous Machine and Synchronous Machine
blocks, the `set`

field is a structure with these
fields.

Field | Description |
---|---|

`BusType` | Character vector (`'P & V generator'` , ```
'P
& Q generator'
``` , `'Swing bus'` ) defining
the bus type of the machine. |

`TerminalVoltage` | Parameter defining the terminal voltage, in volts rms. |

`ActivePower` | Parameter defining the active power, in watts. |

`ReactivePower` | Parameter defining the reactive power, in vars. |

`PhaseUan` | Parameter defining the phase voltage, in degrees, of the Uan voltage. |

For example, the initialization parameter values of the Synchronous
Machine block in the `power_machines`

example are:

Mparam = power_loadflow('power_machines'); Mparam(1).set ans = BusType: 'P & V generator' TerminalVoltage: 2400 ActivePower: 0 ReactivePower: 0 PhaseUan: 0

For the Three-Phase Dynamic Load block, the `set`

field
is a structure with the following fields.

Field | Description |
---|---|

`ActivePower` | Parameter defining the Active power, in watts. |

`ReactivePower` | Parameter defining the reactive power, in vars. |

The results are organized in a structure with the following fields.

Field | Description |
---|---|

`status` | Status returns `1` when a solution is found,
and returns `0` when no solution is found. The status
is given only in the first element of Machine Initialization structure;
it returns an empty value for the other elements. |

`Machine` | The names of the machines or loads. |

`Nominal` | The nominal parameters [nominal power, nominal voltage] of the machines or loads. |

`BusType` | The bus type of the machines or loads. |

`UanPhase` | The phase angles, in degrees, of the phase A-to-neutral voltage at machine or load terminals. |

`Uab,Ubc,Uca` | The steady-state, phase-to-phase terminal voltages of the machines or loads. The voltages are returned in a 1-by-3 vector containing the voltage in volts, the voltage in p.u. based on the nominal power of the machine, and the phase in degrees. |

`Ia,Ib,Ic` | The steady-state phase currents of the machines or loads. The currents are returned in a 1-by-3 vector representing the current in amperes, the current in p.u. based on the nominal power of the machine, and the phase in degrees. |

`P` | The active power of the machine is returned in a 1-by-2 vector, representing the power in watts and in p.u. based on the nominal power of the machine. |

`Q` | The reactive power of the machine is returned in a 1-by-2 vector, representing the power in vars and in p.u. based on the nominal power of the machine. |

`Pmec` | The mechanical power of the machine is returned in a 1-by-2 vector, representing the mechanical power in watts and in p.u. based on the nominal parameters of the machine. |

`Torque` | The mechanical torque of the machine is returned in a 1-by-2 vector, representing the torque in N.m and in p.u. based on the nominal power and speed of the machine. |

`Vf` | The computed field voltage of Synchronous Machine blocks. This parameter is set to an empty value for the other types of machines and loads. |

`Slip` | The computed slip of Asynchronous Machine blocks. This parameter is set to an empty value for the other types of machines and loads. |