bouncingBall.fmu
The bouncingBall implements the following equation:
- der(h) = v;
- der(v) = -g;
- when h<0 then v := -e* v
with start values h=1, e=0.7, g = 9.81 and
- h: height [m], used as state
- v: velocity of ball [m/s], used as state
- der(h): velocity of ball [m/s]
- der(v): acceleration of ball [m/s2]
- g: acceleration of gravity [m/s2], a parameter
- e: a dimensionless parameter
The figure shows the solution computed with Silver
for height h of the ball for the start values given above.
The chain of events during simulation is as follows
- intitially h>0 and pos(0)=true
- continuous integration until a state event is detected, i.e.
until h + EPS_INDICATORS = 0.
At this time h < 0, the EPS_INDICATORS adds hysteresis.
- the simulator calls eventUpdate once which reverses the speed direction
v of the ball: v = -e * v, and sets pos(0)=false
- continuous integration until state event is detected, i.e.
until h - EPS_INDICATORS = 0.
At this time h > 0, the EPS_INDICATORS adds hysteresis.
- the simulator calls eventUpdate once more which sets pos(0)=true.
- goto 2
The above description refers to the variables used
in file bouncingBall.c
.