Previous Page Combined Models Next Page
Combined models contain continuous as well as discrete state transitions represented by differential equations and events.


Hysteresis
Example 1: Hysteresis

STATE VARIABLE
DISCRETE
Polarization (INT) := +1

DEPENDENT VARIABLE
CONTINUOUS B(REAL)

SENSOR VARIABLE
CONTINUOUS H (REAL)

WHENEVER H > Hc
DO
Polarization := +1;
END

WHENEVER
H < Hc AND Polarization = +1
DO
Polarization := -1;
END

B := Polarization * B0 + s*H;
The usage of events in otherwise continuous models allows a representation of very rapid processes in a simple way without loss of numerical stability.

Beispiel 2: Sawtooth Generator

Discrete and continuous state transitions can take place for the same variable.

DIFFERENTIAL EQUATION
Saw Tooth
X' := c;
END

WHENEVER X > a
DO
X^ := -a;
END

The course of the signal x increases linearally with slope c. Once the upper limit a is reached, the value of the variable x jumps to -a. This consumes a time increment dt, but no real time t.

The integration of the differential equation is interrupted just after the condition is true that triggers the event.