Question: Write a function called BallBounce that takes in values for the initial height of a ball above the ground ( h 1 ) and the
Write a function called BallBouncethat takes in values for the initial height of a ball above the ground h and the coefficient of restitution between the ball and the ground e that does the following:
Finds the total distance traveled by the object in the limit that the number of bounces goes to infinity. This value should be the first output of your function.
Finds the number of bounces required for the ball to travel at least of the total distance it will travel. This value should be the second output of your function. Note that if the coefficient of restitution is very small, the ball will travel of the total distance after bounces ie during the initial fall to the ground
Define a row vector that stores the distance traveled as a function of the number of bounces. The last element of this row vector should be the distance traveled once the condition described above is met. This vector should should be the third output of your function. You can perform a preliminary check of this variable by making sure its first element corresponds to the distance traveled for bounces.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
