(*simulation of a bouncing ball and its total energy*)
imagesize=500;
ball=NDSolve[{y''[t]==-9.81,y[0]==13.5,y'[0]==0,WhenEvent[y[t]==0,y'[t]->-0.7 y'[t]]},y,{t,0,10}];
kin[v_]:=.5 v^2;
pot[y_]:=9.8 y;
energy[y_,v_]:=kin[v]+pot[y];
GraphicsGrid[{{Plot[y[t]/.ball,{t,0,10},AxesLabel->{"t","y"}, ImageSize->imagesize],Plot[Evaluate[{kin[y'[t]],pot[y[t]],energy[y[t],y'[t]]}/.ball],{t,0,10},Filling->{3->0},AxesLabel->{"t","energy"}]}}]