Why does the Ideal Switch of the SimPowerSystems Blockset 3.1 (R14) and later exhibit a numerical instability when simulated with a discrete fixed-step solver?

1 view (last 30 days)
The Ideal Switch Block of the SimPowerSystems Blockset versions 3.1 and 4.0 exhibited exponentially decaying oscillations (bouncing) on turning off when simulated in discrete step mode. When simulated in continuous mode the switch operates as expected with no oscillations on closing.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
Circuits that store energy in inductive elements resist rapid current changes. Opening or closing a switch in such a circuit leads to the release of the stored energy, which in real life is often manifested in a spark across the switch terminals, unless an appropriate snubber is supplied.
To model this behavior numerically, one requires a dramatic decrease in the simulation sample time around the event of opening/closing of the switch. This is possible with variable-step continuous solvers, e.g. ODE23TB, which correctly model rapidly decaying current in the circuit at the moment the switch is opened. This is not true for fixed-step solvers. Since the current decay time is usually on the order of one sample time or less, the decay process is undersampled and leads to the numerical instability.
To model the behavior of such a circuit accurately and to prevent the occurrence of the numerical instability, use one of the variable-step solvers. If the use of a fixed-step solver is unavoidable, make sure that the sample time is set low enough to adequately sample the decay process. However, a very small sample time can drastically degrade the overall speed of the simulation.

More Answers (0)

Categories

Find more on Discrete Events and Mode Charts in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!