Question: python 3 Simulating bouncing with different gravity For this homework assignment, you will write a simplified model of a bouncing ball using numpy. Assume the

python 3 Simulating bouncing with different gravity For this homework assignment, youpython 3

Simulating bouncing with different gravity For this homework assignment, you will write a simplified model of a bouncing ball using numpy. Assume the ball is dropped on Venus under constant acceleration g = 8.87 from the limit of its atmosphere, a height of 250km. Model the ball's motion for one hour and 15 minutes (include second and second 4, 500 in your data points). After the initial state, simulate 5,000 updates to the state (for a total of 5,001 points.) Your simulation should use float64 numpy arrays for time (t) and height (y ). Time should be represented in seconds and height should be represented in meters. s2 Bouncing To simulate bouncing, we'll make some simplifying assumptions (since collision detection can be complicated). If the ball's height is ever less than or equal to 0, we will assume that the ball hit the ground before the time step we are simulating and already started bouncing. You should: instantly set its height to . update its velocity to 90% (0.9) of its velocity and reverse the direction of travel-in this case, please use the now-current velocity, i.e., vc [ i ] Count the number of times the ball bounces in an integer variable named bounces Plotting y v. t may be useful for you to understand what results your code is producing. DO NOT try to write your code here. Debugging it here will be very difficult. You should write and test your code on your own computer. Write a program to calculate the problem as specified above. Your submission should include arrays t and y of the proper dimensions and values, and an int named bounces. Simulating bouncing with different gravity For this homework assignment, you will write a simplified model of a bouncing ball using numpy. Assume the ball is dropped on Venus under constant acceleration g = 8.87 from the limit of its atmosphere, a height of 250km. Model the ball's motion for one hour and 15 minutes (include second and second 4, 500 in your data points). After the initial state, simulate 5,000 updates to the state (for a total of 5,001 points.) Your simulation should use float64 numpy arrays for time (t) and height (y ). Time should be represented in seconds and height should be represented in meters. s2 Bouncing To simulate bouncing, we'll make some simplifying assumptions (since collision detection can be complicated). If the ball's height is ever less than or equal to 0, we will assume that the ball hit the ground before the time step we are simulating and already started bouncing. You should: instantly set its height to . update its velocity to 90% (0.9) of its velocity and reverse the direction of travel-in this case, please use the now-current velocity, i.e., vc [ i ] Count the number of times the ball bounces in an integer variable named bounces Plotting y v. t may be useful for you to understand what results your code is producing. DO NOT try to write your code here. Debugging it here will be very difficult. You should write and test your code on your own computer. Write a program to calculate the problem as specified above. Your submission should include arrays t and y of the proper dimensions and values, and an int named bounces

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!