Ball Bouncing on Hilly Terrain
The following application demonstrates how event modeling in the dsolve command can be used to model a ball bouncing on a hilly terrain.
Define the Surface
We define the surface, surf, in the line below. It is possible to modify this equation to show different "terrains".
Derive the Hilly Surface
The velocity vector of a ball:
The surface normal:
The velocity vector after reflection across the surface normal:
Restitution coefficient:
Using represents an inelastic collision between the ball and the surface, whereas using represents an elastic collision.
Differential Equations and Initial Conditions
Gravity acts in the -y direction:
Solve and Animate the Differential Equations
Animate the Ball Bouncing on the Terrain