Extra Credit Project

Differential Equations – Math 3200.002 – Fall 2004

James Leeper

Introduction

This project seeks to describe and analyze the MatLab function ballode.  The function simulates the effect of gravity on a ball being thrown upwards from a height of zero with an initial velocity of 20.  At a height of approximately 20.3705 the ball’s velocity reaches 0 and it begins to fall due to the force of gravity.  At a time of 4.0816 the ball again reaches a height of zero.  At this point, the initial velocity is adjusted by 90% and the simulation is repeated.  This happens each time the ball returns to the origin for 10 cycles.  This produces a bouncing effect.  This one-dimensional motion is displayed in the following graph.

            To show the effect that the attenuation has on the ball motion, another graph was produced with it set to 50%.  That graph is below.

Both of these graphs represent the same differential equation.  The only difference is that the initial velocity of each ‘bounce’ is different.  The image below shows the first two bounces of the solution using 90% attenuation (blue) overlaid with the solution using 50% attenuation (green) adjusted to the same axis size.

            Both of the initial runs are exactly the same because the attenuation does not affect the results until the ball reaches the origin.

 

 

Analysis

            To produce the position plots above, ballode is numerically solving the equation for motion with constant acceleration as discussed in section 1.1 of the text.  The equation, as shown below, is a 2nd order non-homogeneous scalar linear initial value problem using gravity (9.8 m/s2) as the acceleration.

, ,

            To be solved in MatLab using the ode23 function, the equation must be converted to a 1st order non-homogeneous linear system as described in section 6.2 of the text.

,, where  &

Before calculating each bounce the second element of the initial value vector  is updated to the previous value times the attenuation value.  The function ode23 returns two matrices on each of the ten cycles, a column vector t of times and a second vector y containing the position and velocity calculated for each value of t.

Analytically, the solution of the equation for motion is a simple matter of integrating.  Starting with the generic form of the equation for acceleration:

integrate once to derive the equation for velocity:

and a second time for the equation for position:

.

Using the initial conditions

,

produces the particular solution:

.

            While it is trivial to find the solution analytically, the ballode function must use numerical methods to derive estimates of the position and velocity at various times.