|
Case distinctions are necessary for example, if some effects are only active for certain environmental conditions.
Example: Jumping Ball
DIFFERENTIAL EQUATION
x' := v;
v' := a;
END
IF x > R
DO
a := -g;
END
ELSE
DO
a := -g + k1*(R-x) + k2*(R-x)/x;
END
|
|
After touching the ground, an additional linear repulsing force takes action. Gradually, another force with hyperbolic characteristics gets dominant and prevents that the ball is squeezed together totally.
Dependent variables defined within a case distinction must be determined completely which means that they must be assigned in every single branch of the IF-statement, not missing the ELSE-branch. |