The Range of Methods Available
Discontinuities
Why is it necessary to stress the occurrence of discontinuities in simulation models? The problem lies in the integration algorithms used for solving the ODE and DAE equations that arise in simulation. They are based on integration methods which assume that the state variables and some of their derivatives are continuous. If this assumption is not true, special precautions have to be taken at the discontinuity points. This can be illustrated by a simple graph shown below.
The variable has two distinct characteristics resulting in two distinct curves C1 and C2. The variable is continuous but the derivative is discontinuous at the point P. The integration methods are fine when integrating along C1 but at point P problems arise. If no special precautions are taken, as in the following pseudo code:
Copy
if(condition)
use formula for C1
else
use formula for C2
endif
The integrator will drastically reduce its step near the point P in a desperate attempt to meet accuracy requirements. Many integrators will give up with an error message when the step gets too small. Others will have a minimum step size and when this is reached will carry on, even though the accuracy requirements are not met. The first approach leads to frustration and the second can lead to highly inaccurate results.
In the past many simulation packages accepted this situation but now it is almost universally recognized that discontinuities should be handled in a more careful manner. The idea is simple in concept. If the solution is on curve C1 and goes past the point P then the equation for C2 is not used. Instead the equation for C1 is still used so that effectively the curve C1’ is employed. This gives rise to a point Q being predicted. The integrator must then realize that a discontinuity point has been passed over and start trying to locate it. This can be done in two ways. Either the integrator tries with a series of smaller step sizes or some form of interpolation is used. Either way, the point P is located within reasonable accuracy (or even to machine accuracy).
After this the integrator restarts itself, forgetting all information to the left of point P, and using the smooth curve C2.
This arrangement can be made to work very well but relies on cooperation between the integration algorithm and the model. In practice, messages must be sent between them such that the model detects the discontinuity and informs the integrator. The integrator informs the model when a restart is in progress so that various initializations can be done.
Source: https://docs.sw.siemens.com/en-US/doc/254352342/PL20250521841123434.amesim_collection.TB102_Integrator/xid1848007 · retrieved 2026-07-17