Accelerating the pace of engineering and science

Documentation Center

• Trial Software

Simulating Discretized Electrical Systems

Introduction

You implement discretization by selecting Discretize electrical model in the Powergui block dialog box. The sample time is specified in the block dialog box. The electrical system is discretized using the Tustin method (equivalent to a fixed-step trapezoidal integration) or the Backward Euler method.

The Tustin method usually gives better accuracy. However, for circuit containing diodes and thyristors, the Backward Euler method allows using negligible snubbers while avoiding the numerical oscillations that are observed with the Tustin method.

To avoid algebraic loops, the electrical machines are discretized using the Forward Euler method. For the asynchronous and synchronous machines, you can also use the trapezoidal method (either iterative or non-iterative).

The precision of the simulation is controlled by the time step that you choose for the discretization. If you use too large a sample time, the precision might not be sufficient. The only way to know if it is acceptable is to repeat the simulation with different sample times or to compare it with a continuous method and to find a compromise for the largest acceptable sample time. Usually sample times 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. However, for systems using forced-commutated power electronic switches, you must reduce the time step. These devices, the insulated-gate-bipolar transistor (IGBT), the field-effect transistor (FET), and the gate-turnoff thyristor (GTO) are usually operating at high switching frequencies. For example, simulating a pulse-width-modulated (PWM) inverter operating at 8 kHz requires a maximum time step of 1 µs or less.

Even if you discretize your electric circuit, you can still use a continuous control system. However, the simulation speed is improved by use of a discrete control system.

Discretizing Switches and Power Electronics

Switches and power electronic devices are nonlinear elements which are represented by a purely resistive element having a low Ron resistance when the switch is closed and an infinite resistance when the switch is opened. Each time a switch status is changed during the simulation, the discrete state-space model of the linear part of the circuit is re-evaluated to take into account the change in circuit topology. Due to the way the state-space model is computed, switches cannot be connected in series with inductive circuits. For most applications, snubber circuits have to be connected across power electronic devices.

For forced-commutated devices, the snubber circuit can be made negligible by using purely resistive snubbers with a high resistance. However, for circuits containing naturally commutated devices such as diodes and thyristors, because a fixed simulation time step is used, when the device is blocked, the current zero-crossing is not detected accurately. The small negative current chopping produces numerical oscillations which can be controlled by connecting RC snubbers across diodes and thyristors. The size of the RC snubber depends on the sample time and on the discretization method used for the linear electrical circuit.

You select the discretization method in the Configure parameters menu of the Powergui block. The default discretization method is the Tustin method which is equivalent to a fixed-step trapezoidal integration. Since R2011b, you can use an alternative discretization method: the Backward Euler method. The Tustin method is recommended for most applications. However, for circuits containing diodes and thyristors, the Backward Euler method allows using negligible snubbers while preserving numerical stability. The drawback of the Backward Euler method is its lower accuracy. An accuracy equivalent to the Tustin method can be obtained by using a smaller sample time.

Example of discrete model using Tustin and Backward Euler methods

The following example uses the power_rectifier example to illustrate the impact of the snubbers and discretization method on model stability.

1. Open the power_rectifier example. This circuit is a rectifier using three diodes connected in parallel with a RC snubber (Rs = 1000 Ω; Cs = 0.1μF).

2. In the Powergui menu, select Configure parameters, select Simulation type to Discrete, keep Solver type to Tustin, and specify a Sample time of 50 µs. Simulation results of the discretized model are very close to the waveforms obtained with the continuous model.

3. Now simulate this discrete model with negligible snubbers. You may use a purely resistive snubber with a negligible resistance, Rs= 100 kΩ. Change the snubber values in the diode block menus to Rs= 1e5; Cs = inf.

4. Start the simulation. The results show that numerical oscillations are present on the rectified voltage (Vd) and on the diode voltages.

Waveforms obtained with Tustin solver; Ts=50us; Resistive snubber Rs=100 kΩ

5. Change the Solver type to Backward Euler and repeat the simulation. You notice that the numerical oscillations are gone. On the following figure simulation results are compared with results obtained from the Continuous solver. For this particular sample time (Ts = 50 ms) waveforms are very close to the previous ones. To obtain maximum accuracy with the continuous solver the following simulation parameters were used: Tolerance = le-4; Absolute Tolerance = le-4; Solver Reset Method = Robust.

Comparison of waveforms obtained with continuous and discrete Backward Euler solvers

Discretizing Electrical Machines

Electrical machines are nonlinear elements simulated as current sources. These elements cannot be connected to an inductive network unless a parasitic resistive or capacitive element is connected at machine terminals.

When using electrical machines in discrete systems, you might have to increase these parasitic resistive load to avoid numerical oscillations. The amount of parasitic load depends on the sample time and on the integration method used to discretize the electrical machine.

For the Synchronous Machine model and the Asynchronous Machine model, you can select either a Forward Euler or a Trapezoidal discretization method. For all other machine models, use the Forward Euler discretization method.

For the Synchronous Machine and the Asynchronous Machine, you select the machine discretization method in the Advanced Tab of the block menu. When using an implicit solver, such as the Trapezoidal iterative model, you obtain the highest accuracy. Using this model produces an algebraic loop, which forces the Simulink® solver to iterate, resulting in a higher accuracy. However, this higher accuracy is at the expense of a slower simulation speed.

The Trapezoidal iterative model allows you to simulate machines with negligible parasitic loads while preserving numerical stability. However, if your model contains many machines and nonlinear elements such as power electronic devices, the Simulink solver might fail to solve the algebraic loop. In such a case you must use a noniterative discretization method such as the Forward Euler model or the Trapezoidal noniterative model (Trapezoidal model in which the algebraic loop is broken by introducing a Unit Delay).

Using noniterative solvers requires larger parasitic loads or a smaller sample time. The minimum resistive load is proportional to the sample time. Remember that with a 25 μs time step on a 60 Hz system, the minimum load is approximately 2.5% of the machine nominal power. For example, a 200 MVA synchronous machine in a power system discretized with a 50 μs sample time requires approximately 5% of resistive load or 10 MW. If the sample time is reduced to 20 μs, a resistive load of 4 MW is sufficient.

Example of discrete model using SM and ASM blocks

The following example uses power_machines to illustrate impact of the machine discretization methods and amount of parallel load on model stability.

1. Open the power_machines example. This example contains a synchronous machine (SM) and an asynchronous machine (ASM) connected at the same bus in parallel with a 1 MW load.

2. In the Powergui menu, select Configure parameters, select Simulation type = discrete, and specify a sample time of Ts = 50 μs.

3. Use the Load Flow tool to initialize the machine models (click the Compute and Apply buttons in the Powergui Load Flow window).

4. Start the simulation and observe that the model starts in a steady-state.

In this model, the default discretization method specified in the Advanced Tab of the synchronous machine block and of the asynchronous machine block is Forward Euler. The model is stable because a relative large load of 1 MW is connected at the machine terminals. This load represents 32% of the SM nominal power and 60% of the ASM nominal power.

The following figure compares simulation results of the two noniterative discrete models (Forward Euler and Trapezoidal noniterative) with the reference waveforms obtained from the continuous model. In the figure, three sets of waveforms are shown for phase A voltage (trace 1), phase A current of ASM (trace 2), phase A current of SM (trace 3), and ASM and SM speeds (trace 4).

• Continuous model (blue)

• Discrete model using ASM and SM Forward Euler models (red)

• Discrete model using ASM and SM Trapezoidal noniterative models (green)

The Trapezoidal noniterative model provides better accuracy than the Forward Euler model. The simulation error is particularly visible on trace 2 and on trace 3 showing that the Forward Euler model fails to preserve the DC component of the ASM and SM currents.

Now simulate this discrete model with virtually no load connected at machine terminals. You may try decreasing the 1 MW load to say 1 kW (representing respectively 0.032% and 0.06% of SM and ASM machine nominal powers).

Change the resistive load from 1MW to 1 kW and start simulation. Notice the numerical oscillations, because the 1 kW load is too small to guarantee stability of the Forward Euler machine models.

If you vary the load by steps of 50 kW, you discover that the minimum load required to obtain a stable model is 150 kW for the Forward Euler model, corresponding to 3.1% of the total machine nominal power (4.80 MVA = 3.125 MVA for ASM + 1.678 MVA for SM). When using the Trapezoidal noniterative model, the minimum load is 350 kW (7.2% of the total machine nominal power).

The only way to simulate this discrete model with a 1 kW load is to use the Trapezoidal iterative method for both machines. Simulink now displays a warning signalling an algebraic loop. Simulation results are exact and are as accurate as the Continuous model. The drawback is a much slower simulation speed.