You are taking part in a golf driving-range competition to see who can hit the ball...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
You are taking part in a golf driving-range competition to see who can hit the ball farthest. The distance that counts is where the ball lands on its third bounce. In this task, you will write your own ODE solving suite that performs Modified Euler (also known as Improved Euler) time stepping, and use the suite to solve for the trajectory of a golf ball, ac- counting for air resistance. The system of differential equations that governs the motion of a pro- jectile, like a golf ball, is x"(t) = -K x' (t) y"(t)-g-K y' (t), = where g is 9.81 m/s, and K is a coefficient of air resistance. You may assume that K always equals 0.3 for this task. (a) Complete the Python function Myode, t, y = Myode (de, tspan, y0, h, event) that numerically solves the IVP using Modified Euler time stepping using a fixed time step of h. See the help documentation in the supplied code for an explanation of the input and output variables. Importantly, your function should ignore the event function for the first time step. Note that if Myode detects the occurrence of an event, it should linearly interpolate between the last two points to find a more accurate estimate for the time of the event. Then it should interpolate the state at that new, interpolated end time. (b) Formulate the system of ODEs above into a first order system, and create a Python function called projectile that fits the prototype of the dynamics function described in the Myode help. (c) The driving range has rolling hills, so that the level of the ground is a cosine function, = 2 (cos (1) - () - sin (1)-) Ground (d) = 2 ( cos where d is the horizontal distance from the golf tee. The supplied function, Ground, eval- uates this for you. Write a simple event function that changes sign as the golf ball hits the ground. Your event function should be continuous, not a step function. Call your event function projectile_events. This function should also fit the prototype described in the Myode help. The notebook calls your ODE suite to numerically solve the above golf-ball trajectory IVP and plots the resulting trajectory (including the level of the ground). The initial state is set so that the golf ball starts at the origin, and has an initial speed of 58 m/s at an angle of 0 from the ground. A "flight" is the motion of the ball between contacts with the ground. For example, the first flight starts when the ball is initially hit, and ends when the ball next hits the ground. The second flight starts at the bounce from the first strike, and ends when the ball strikes the ground for the second time. The figure below shows the ball's trajectory over 3 flights. 0 = 50, Ball ended at 139.45m Height (m) 60 50 40 30 20 10 0- -10 25 50 U 75 Distance (m) 100 125 150 When the ball bounces, its velocity vector is abruptly changed. The figure below shows the geom- etry of a bounce, with the ball's incident velocity vector (7) and its velocity vector after the bounce (V), based on unit vectors that are tangent to the ground () and normal to the ground (). You can use the supplied function GroundSlope to get the slope of the ground, and use that to construct u and U. Note that the bounce speed is only 85% of the incident speed. 1 = 0.85 ((v ) (v )) (d) Add some code to the notebook to simulate the first 3 flights of the ball (as shown in the figure above). Note that each flight is simulated by a call to Myode, with the initial position and velocity determined by the bounce from the previous flight. (e) Re-run the code for different 0-values, and determine the angle (to the nearest degree) that has the ball end (on its 3rd ground strike) the furthest horizontal distance from the golf tee. Plot the trajectory for your chosen (-value. You are taking part in a golf driving-range competition to see who can hit the ball farthest. The distance that counts is where the ball lands on its third bounce. In this task, you will write your own ODE solving suite that performs Modified Euler (also known as Improved Euler) time stepping, and use the suite to solve for the trajectory of a golf ball, ac- counting for air resistance. The system of differential equations that governs the motion of a pro- jectile, like a golf ball, is x"(t) = -K x' (t) y"(t)-g-K y' (t), = where g is 9.81 m/s, and K is a coefficient of air resistance. You may assume that K always equals 0.3 for this task. (a) Complete the Python function Myode, t, y = Myode (de, tspan, y0, h, event) that numerically solves the IVP using Modified Euler time stepping using a fixed time step of h. See the help documentation in the supplied code for an explanation of the input and output variables. Importantly, your function should ignore the event function for the first time step. Note that if Myode detects the occurrence of an event, it should linearly interpolate between the last two points to find a more accurate estimate for the time of the event. Then it should interpolate the state at that new, interpolated end time. (b) Formulate the system of ODEs above into a first order system, and create a Python function called projectile that fits the prototype of the dynamics function described in the Myode help. (c) The driving range has rolling hills, so that the level of the ground is a cosine function, = 2 (cos (1) - () - sin (1)-) Ground (d) = 2 ( cos where d is the horizontal distance from the golf tee. The supplied function, Ground, eval- uates this for you. Write a simple event function that changes sign as the golf ball hits the ground. Your event function should be continuous, not a step function. Call your event function projectile_events. This function should also fit the prototype described in the Myode help. The notebook calls your ODE suite to numerically solve the above golf-ball trajectory IVP and plots the resulting trajectory (including the level of the ground). The initial state is set so that the golf ball starts at the origin, and has an initial speed of 58 m/s at an angle of 0 from the ground. A "flight" is the motion of the ball between contacts with the ground. For example, the first flight starts when the ball is initially hit, and ends when the ball next hits the ground. The second flight starts at the bounce from the first strike, and ends when the ball strikes the ground for the second time. The figure below shows the ball's trajectory over 3 flights. 0 = 50, Ball ended at 139.45m Height (m) 60 50 40 30 20 10 0- -10 25 50 U 75 Distance (m) 100 125 150 When the ball bounces, its velocity vector is abruptly changed. The figure below shows the geom- etry of a bounce, with the ball's incident velocity vector (7) and its velocity vector after the bounce (V), based on unit vectors that are tangent to the ground () and normal to the ground (). You can use the supplied function GroundSlope to get the slope of the ground, and use that to construct u and U. Note that the bounce speed is only 85% of the incident speed. 1 = 0.85 ((v ) (v )) (d) Add some code to the notebook to simulate the first 3 flights of the ball (as shown in the figure above). Note that each flight is simulated by a call to Myode, with the initial position and velocity determined by the bounce from the previous flight. (e) Re-run the code for different 0-values, and determine the angle (to the nearest degree) that has the ball end (on its 3rd ground strike) the furthest horizontal distance from the golf tee. Plot the trajectory for your chosen (-value.
Expert Answer:
Answer rating: 100% (QA)
The image you sent shows a golf ball trajectory over 3 flights The ground is a cosine function and the ball starts at the origin with an initial speed ... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
What is the purpose of a cover letter? What questions about you should a good cover letter be able to answer for a potential employer? In what ways could you tailor a cover letter to the position you...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
Match each of the following energy band structures with the type of material it represents. Show Work A B C Empty conduction band Band gap Filled valence band Empty conduction band Band gap Filled...
-
A 5-m-long beam is subjected to a variety of loadings. (a) Replace each loading with an equivalent force-couple system at end B of the beam. (b) Which of the loadings are equivalent? 60) N -5 m 400 N...
-
The weight of topsoil sold in a week is normally distributed with a mean of 8 0 0 tons and a standard deviation of 8 0 tons. ( a ) What percentage of weeks will sales exceed 9 6 0 tons? ( Round your...
-
Cotton Pricing Although the abundance and availability of data have increased rapidly due to technology advances, and computers make fancier and fancier visualizations, data visualization itself is...
-
Assume the Carson Coffee Roasters Corp. ended the month of August 2017 with these data: Requirement 1. Prepare the statement of cash flows of Carson Coffee Roasters Corp., for the month ended August...
-
Jessica Lange owns her own high-end hair salon and employs several hair stylists. Customers usually pay using either a debit card or a credit card, but they sometimes write checks or pay with cash....
-
The proposed rates were not in the range the CEO expected given the pricing analysis. The CEO has asked the pricing actuary to verify the total projected loss cost excluding potential large storm...
-
Issuing Common Stock Valdez Manufacturing sold 22,400 shares of common stock to stockholders at the time of its incorporation. Valdez received $24.40 per share for the stock. Required: Question...
-
What determines an ads visual and verbal persona?
-
Explain the different types of speakers and sounds used in television commercials?
-
How does magazine advertising build brand loyalty?
-
Why is direct mail often referred to as junk mail, and how can that perception be turned around?
-
Explain the strategy behind using newspaper in an IMC campaign.
-
3. (35%) Calculate for 1 mole: a) Entropy of SIC at 800C. b) Entropy change of SIC when it is cooled from 800C to room temperature. Data: S2 (SIC) = 51.07 s/mol.K Hr-Hage-46570+ 115.0 T+5.9 x 10 T+...
-
Write an SQL statement to display all data on products having a QuantityOnHand greater than 0.
-
John Fuji (age 37) moved from California to Washington in December 2011. He lives at 468 Cameo Street, Yakima, WA 98901. John's Social Security number is 571-78-5974 and he is single. His earnings...
-
Ken paid the following amounts for interest during 2012: Qualified interest on home mortgage...........................................$4,700 Auto loan...
-
Karim Depak received a Form 1099-B showing the following stock transactions and basis during 2012: None of the stock is qualified small business stock. Calculate Karim's net capital gain or loss...
-
A positively charged particle creates the electric field shown in Figure 30. 20. When the kinks in the electric field lines reach the rod, what is the direction of the current induced in the rod?...
-
Suppose the current shown in Figure 30. 19 discharges the capacitor. What are the directions of \(\vec{E}\), \(\Delta \vec{E}\), and \(\vec{B}\) between the plates of the discharging capacitor? Data...
-
For the oscillating dipole of Figure 30. 14, sketch the electric field pattern at \(t=\frac{5}{4} T\). Data from Figure 30.14 0=1 t = T t=T 1=T O O D
Study smarter with the SolutionInn App