model BouncingBall "The 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; Velocity v; initial equation h = h0; equation der(h) = v; der(v) = -9.81; when h<0 then reinit( v, -e*pre(v)); end when; annotation (experiment(StopTime=4, NumberOfIntervals=5000), experimentSetupOutput); end BouncingBall;