Solve Part 4: Part I: (40 pts) Use Euler’s method as I do. However, for the if-condition…
- User
Solve Part 4:
Part I: (40 pts) Use Euler’s method as I do. However, for the if-condition that identifies when the ball hits the wall or goes past the wall, modify the calculation by adding a linear interpolation. To do this, first assume the same equation of motion that would occur if the floor was not present. Then calculate the velocity that the ball will have just before the collision at 𝑦 = 0 using linear interpolation of a velocity versus height. Let us model the motion of the ball that is outside the time interval when it collides with the wall using a time resolution of 𝑑𝑡 = 0.001 seconds. At the wall, it will generally be the case that the time the ball hits the floor will not be a perfect multiple of 𝑑𝑡, but rather an incomplete time interval that must be ≤ 𝑑𝑡. As such, plan on making tArray() non-uniform. Once the collision between the ball and floor takes place, you should then track the flight of the ball upward initially, and follow it back down until the ball hits the floor again. At this point, you will have the same situation. This cycle can be repeated up to the maximum time of interest, which can be specified, although I used 20 seconds. Hint: Each time you work out the time that the ball hits the floor, you will need to modify the tArray to reflect starting at the floor with some initial velocity upward. Turn this script in as bouncingBallName01.m where Name is your first or last name. This will be version 01. Part II: (25 pts) Now, within the if-condition block that identifies when the ball hits the wall or goes pass the wall, modify the calculation by adding a sub-loop within this if-condition block. Within this subloop, break up the 𝑑𝑡 into smaller intervals. Let us call this time interval 𝑑𝑡!"## . I suggest 𝑑𝑡!"## = 𝑑𝑡/1000. The code is similar to my initial code, where the y position of the ball is rest to zero upon its change in direction. The difference will be that the time interval for solving the differential equation numerically using Euler’s method is much smaller. Construct the loop in a way that when you record the positions and velocities, you will keep the same 𝑑𝑡 determined by the tArray(). This method is useful when modeling the collision between ball and floor in detail. Turn this script in as bouncingBallName02.m Part III: (15 pts) Do everything analytically. We know the exact equations of motion of the ball, except during the collision. However, by assuming the collisions take place instantaneously, we can solve the equations of motion up to the exact instant of time the ball touches the floor, and then, switch the velocity using the coefficient of restitution, and then, solve the exact analytical equations again until the next exact time the ball hits the floor. In this case, use non uniform 𝑑𝑡. Since you can calculate the time between bounces, always plot 40 points between the times the ball bounces. In this way, you will have an exact solution under the simplifying assumptions of the model. Turn this script in as bouncingBallName03.m Part IV: (20 pts) Compare your three results. Discuss what you find, and describe how the results from the three different approaches are similar and different. Write this as a paragraph (or more) in a WORD document (or some other word processing means) and include graphs to support your discussion.
- Assistant
In Part IV, we are asked to compare the results from the three different approaches (Euler's method with linear interpolation, Euler's method with smaller time intervals, and analytical solution) and discuss their similarities and differences.
First, let's discuss the similarities. In all three approaches, the ball exhibits a bouncing motion due to the collision with the floor. The graphs of the ball's position and velocity versus time show similar patterns with peaks and valleys corresponding to each bounce. Additionally, all three approaches capture the concept of energy conservation, where the ball loses energy with each bounce due to the imperfect nature of the collision. This is evidenced by the fact that the maximum height reached by the ball decreases with each bounce.