I would like to understand the general idea behind hybrid modelling (in particular state events) from a numerical point of view (although I am not a mathematician :)). Given the following Modelica model:
model BouncingBall
constant Real g=9.81
Real h(start=1);
Real v(start=0);
equation
der(h)=v;
der(v)=-g;
algorithm
when h < 0 then
reinit(v,-pre(v));
end when;
end BouncingBall;
I understand the concept of when and reinit.
- The equation in the
whenstatement are only active when the condition become true right? - Let's assume that the ball would hit the floor at exactly
2sec. Since I am using multi-step solver does that mean that the solver "goes beyond 2 seconds", recognizes thath<0(lets assume at simulationtime = 2.5sec,h = -0.7). What does this mean "The time for the event is searched using a crossing function? Is there a simple explanation(example)? - Is the solver now going back? Taking a smaller step-size?
- What does the
pre()operation mean in that context? noEvent(): "Expressions are taken literally instead of generating crossing functions. Since there is no crossing function, there is no requirement tat the expression can be evaluated beyond the event limit": What does that mean? Given the same example with the bouncing ball: The solver detects at time 2.5 that h = 0.7. Whats the difference between with and withoutnoEvent()?