SimPowerSystems    

How SimPowerSystems 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 power_analyze command is part of that process. It obtains the state-space model and builds the Simulink model of your circuit. You can also call power_analyze from the command line to obtain the state-space model of the linear part of the circuit. When called by the initialization process, power_analyze performs the following five steps as shown in Figure 4-1:

  1. Sorts all SimPowerSystems blocks, gets the block parameters and evaluates the network topology. The blocks are separated into linear and nonlinear blocks, and each electrical node is automatically given a node number.
  2. Once the network topology has been obtained, the state-space model (A, B, C, D matrices) of the linear part of the circuit is computed by the power_statespace command. All steady-state calculations and initializations are performed at this stage.

  1. If you have chosen to discretize your circuit, the discrete state-space model is computed from the continuous state-space model, using the Tustin method.

    If you are using the phasor solution method, the state-space model is replaced with the complex transfer matrix H(j) relating inputs and outputs (voltage and current phasors) at the specified frequency. This matrix defines the network algebraic equations.

  1. Builds the Simulink model of your circuit and stores it inside one of the measurement blocks. This means that you need at least one measurement block (Current Measurement block, Voltage Measurement block, Three-Phase V-I Measurement block, or Multimeter block) in your model. The connections between the equivalent circuit and measurements blocks are performed by invisible links using the Goto and From blocks.

Figure 4-1: SimPowerSystems Flowchart

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 SimPowerSystems. Simulink Source blocks connected at the input of the State-Space block are used to simulate the electrical source blocks.

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 4-2: Interconnection of Linear Circuit and Nonlinear Models

Once power_analyze has completed the initialization process, Simulink starts the simulation. You can observe waveforms on scopes connected at the outputs of your measurement blocks. Through the Powergui, you can access the LTI viewer and obtain transfer functions of your system between any pair of input and output. The Powergui also allows you to perform a FFT analysis of recorded signals in order to obtain their frequency spectrum.

If you stop the simulation and drag a copy of the Powergui block into your circuit window, you 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.


  Improving Simulation Performance Choosing an Integration Method 

Learn more about the latest releases of MathWorks products:

 © 1994-2009 The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS