model BouncingBall "The 'classic' bouncing ball model" type Height=Real(unit="m"); type Velocity=Real(unit="m/s"); parameter Real e=0.8 "Coefficient of restitution"; parameter Height h0=1.0 "Initial height"; Height h "Height"; Velocity v(start=0.0, fixed=true) "Velocity"; initial equation h = h0; equation v = der(h); der(v) = -9.81; when h<0 then reinit(v, -e*pre(v)); end when; annotation (experiment(StopTime=3.5, NumberOfIntervals=5000)); end BouncingBall;