Simulating Transients


In this section you

  • Learn how to create an electrical subsystem

  • Simulate transients with a circuit breaker

  • Compare time domain simulation results with different line models

  • Learn how to discretize a circuit and compare results thus obtained with results from a continuous, variable time step algorithm

Simulating Transients with a Circuit Breaker

One of the main uses of Simscape™ Power Systems™ software is to simulate transients in electrical circuits. This can be done with either mechanical switches (circuit breakers) or switches using power electronic devices.

  1. Open the power_gui example model.

  2. Insert a circuit breaker into your circuit to simulate a line energization by opening the Fundamental Blocks/Elements library. Copy the Breaker block into the power_gui example.

  3. Open the Breaker block dialog box and set its parameters as follows:


    0.001 Ω

    Initial status

    0 (open)





    Switching times


  4. Insert the circuit breaker in series with the sending end of the line, then rearrange the circuit as shown in the figure.

  5. Right-click the two lines that connect to the Scope 1 block and select Properties. In the dialog box, select Log signal data for the two signals and click OK. From the Simulation Data Inspector menu , select Send Logged Workspace Data to Data Inspector.

  6. Open the PI section Line dialog box and make sure the number of sections is set to 1. Start the simulation.

  7. Open the PI section Line dialog box and change the number of sections from 1 to 10. Start the simulation.

  8. Delete the PI section line model and replace it with a single-phase Distributed Parameter Line block. Set the number of phases to 1 and use the same R, L, C, and length parameters as for the PI section line. Start the simulation.

  9. You can now compare the three waveforms obtained with the three line models. Open the Simulation Data Inspector. Select the Ub1 and Ub2 signals of Run 1, the Ub2 signals of Run 2, and Run 3.

A zoom on these waveforms is shown in the next figure. As expected from the frequency analysis performed during Analyze a Simple Circuit, the single PI model does not respond to frequencies higher than 229 Hz. The 10 PI section model gives a better accuracy, although high-frequency oscillations are introduced by the discretization of the line. You can clearly see in the figure the propagation time delay of 1.03 ms associated with the distributed parameter line.

Receiving End Voltage Obtained with Three Different Line Models

Discretizing the Electrical System

An important product feature is its ability to simulate either with continuous, variable step integration algorithms or with discrete solvers. For small systems, variable time step algorithms are usually faster than fixed step methods, because the number of integration steps is lower. For large systems that contain many states or many nonlinear blocks such as power electronic switches, however, 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-turnoff 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 most 1 µs.

  1. Open the power_3level example. In the Powergui block, note that the Simulation type is set to Discrete and the sample time is set to 1e-6 s by the Ts variable defined in the Model Properties. Run a first simulation.

  2. To perform a continuous simulation, open the Powergui block parameters dialog box and set Simulation type to Continuous. Select Use ideal switching devices. Select the ode23tb variable-step solver in the Configuration Parameters dialog box. Simulate the model.

  3. In the Powergui block, set Simulation type to Discrete. In the command window, specify Ts = 20e-6. Run the simulation.

  4. Open the Simulation Data Inspector and compare the differences on the high-frequency transients.

The 1 µs compares reasonably well with the continuous simulation. However, increasing the time step to 20 µs produces appreciable errors. The µs time step would therefore be acceptable for this circuit, while obtaining a gain on simulation speed.

Was this topic helpful?