14.7. The Flight of a Home Run Baseball¶
It was the bottom of the ninth inning of game 1 of the 2015 World Series. The New York Mets led the Kansas City Royals 4 to 3 with one out in the bottom of the ninth inning and then this happened. Watch the video and make note of two things – how long was the ball in the air (measure with a stop-watch), and estimate how far the ball went before hitting the ground. I used . The marker on the wall gives us a starting point to estimate how far the ball went. I used .
You are to write a MATLAB script that will plot the vertical and horizontal path of the ball. Fig. 14.1 shows an example plot. The script should also display the maximum height, initial velocity, and initial projection angle of the ball. The steps listed below will guide you.
The horizontal and vertical paths of the ball may be calculated independently.
First make variables for constant values – gravity: , final time of flight: in seconds, Initial height: , and the final horizontal displacement: in feet. Also use
linspace
to make a 100 element vector, for time from 0 to .The vertical path of the ball may be treated the same as for throwing a ball straight up. The only force on the ball worth noting is gravity. The height of the ball is given by
Using the value measured with the stop watch, calculate , which occurs when . The path of the ball may be calculated now.
Next use the final horizontal displacement, , to calculate the initial horizontal velocity. Air resistance will slightly slow the horizontal displacement [ADAIR90] according to the differential equation,
The solution to the differential equation is
Then, the displacement comes from the definite integral of the velocity.
The constant value of 0.2 is an estimated, typical value. The real value is dependent on other factors such as the wind speed and direction that we don’t know.
From simple trigonometry, , and can be expressed in terms of and . Hint: Use the
atan2d
function to find .Plot the path with a
'LineWidth'
of 2.Show the home run wall by plotting a green line with
'LineWidth'
of 3. Make the wall 10 feet tall at 410 feet from home plate.Remember to annotate the plot and to report the maximum height, initial velocity, and initial projection angle of the ball.
In addition, save the plot to a png file and submit it to the Canvas assignment page.