SimPowerSystems | ![]() ![]() |
How the Power System Blockset Works
Once you have built your circuit with the blocks of powerlib, you can start the simulation just like any other Simulink model. Each time you start the simulation, a special initialization mechanism is called. This initialization process computes the state-space model of your electric circuit and builds the equivalent system that can be simulated by Simulink.
The power2sys
function is part of the process. It gets the state-space model and builds the Simulink model of your circuit. power2sys
can also be called from the command line to obtain the state-space model of the linear part of the circuit. When called by the initialization process, power2sys
performs the following four steps as shown in Figure 3-1:
circ2ss
function. All steady-state calculations and initializations are performed at this stage.
The Simulink model uses a State-Space block or an S-Function block to model the linear part of the circuit. Predefined Simulink models are used to simulate nonlinear elements. These models can be found in the powerlib_models library available with Power System Blockset. Simulink source blocks connected at the input of the State-Space block are used to simulate the electrical sources blocks.
Figure 3-1: Power System Blockset Flowchart
The next figure represents the interconnections between the different parts of the complete Simulink model. The nonlinear models are connected in feedback between voltage outputs and current inputs of the linear model.
Figure 3-2: Interconnection of Linear Circuit and Nonlinear Models
Once power2sys has completed the initialization process, Simulink starts the simulation and you can observe waveforms on scopes connected at the outputs of your measurement blocks.
If you stop the simulation and drag a copy of the Powergui block into your circuit window, you will have access to the steady-state values of inputs, outputs, and state variables displayed as phasors. You can also use the interface to modify the initial conditions. The Powergui block interface allows you to perform a load flow with circuits involving three-phase machinery and initialize the machine models so that the simulation starts in steady state. This feature avoids long transients due to mechanical time constants of machines. The Powergui block allows you to specify the desired frequency range, visualize impedance curves, and store results in your workspace for Impedance Measurement blocks connected in your circuit.
![]() | Advanced Topics | Choosing an Integration Method: Continuous or Discrete | ![]() |