SimPowerSystems    

Discretizing the Electrical System

One important feature of the Power System Blockset, which has been introduced with Version 2.0, is its ability to simulate either with continuous variable time-step integration algorithms or with discrete solvers. For small systems, variable time steps algorithms are usually faster than fixed-time step methods, because the number of integration steps is lower. However, for large systems that contain many states or many nonlinear blocks such as power electronic switches, it is advantageous to discretize the electrical system.

When you discretize your system, the precision of the simulation is controlled by the time step. If you use too large a time step, the precision might not be sufficient. The only way to know if it is acceptable is to repeat the simulation with different time steps and find a compromise for the largest acceptable time step. Usually time steps of 20 µs to 50 µs give good results for simulation of switching transients on 50 Hz or 60 Hz power systems or on systems using line-commutated power electronic devices such as diodes and thyristors. You must reduce the time step for systems using forced-commutated power electronic switches. These devices, the insulated-gate bipolar transistor (IGBT), the field-effect transistor (FET), and the gate-turn-off thyristor (GTO) are operating at high switching frequencies.

For example, simulating a pulse-width modulated (PWM) inverter operating at 8 kHz would require a time step of at least 1 µs.

You will now learn how to discretize your system and compare simulation results obtained with continuous and discrete systems. Open the circuit2_10pi system that you saved from a previous simulation. This system contains 24 states and one switch. Copy the Discrete System block of the powerlib library into your circuit5 system. Open it and set the sample time to 25e-6 s. When you restart the simulation, the power system is discretized using the Tustin method (corresponding to trapezoidal integration) using a 25 µs sample time.

Open the Simulation --> Simulation parameters --> Solver dialog and set the simulation time to 0.2 s. Start the simulation.

In order to measure the simulation time, you can restart the simulation by entering the following commands:

When the simulation is finished the elapsed time in seconds is displayed in the MATLAB window.

To return to the continuous simulation, open the Discrete System block and set the Sample time to zero. If you compare the simulation times, you will find that the discrete system simulates approximately 3.5 times faster than the continuous system.

In order to compare the precision of the two methods, perform the following three simulations:

  1. Simulate a continuous system, with Ts = 0.
  2. Simulate a discrete system, with Ts = 25 µs.
  3. Simulate a discrete system, with Ts = 50 µs.

For each simulation, save the voltage U2 in a different variable. Use respectively U2c, U2d25, and U2d50. Plot the U2 waveforms on the same graph by entering the following command:

Using the zoom button of the graphic window, zoom in on the 4 - 12 ms region. You will see differences on the high frequency transients. The 25 µs compares reasonably well with the continuous simulation. However, increasing the time step to 50 µs produces appreciable errors. The 25 µs time step would therefore be acceptable for this circuit, while obtaining a gain of 3.5 on simulation speed.

Figure 1-7: Comparison of Simulation Results for Continuous and Discrete Systems


  Continuous Variable Time-Step Integration Algorithms Session 4: Introducing Power Electronics