Question: Please solve the following questions and provide the Matlab code. Problem #3: We can now apply Heun's method to our system in Problem #1, where

 Please solve the following questions and provide the Matlab code. Problem#3: We can now apply Heun's method to our system in Problem

Please solve the following questions and provide the Matlab code.

#1, where the dependent variable is now a vector of unknowns Y: (x1, x2, v1, v2). Our system of four ODEs is x1'

Problem #3: We can now apply Heun's method to our system in Problem #1, where the dependent variable is now a vector of unknowns Y : (x1, x2, v1, v2). Our system of four ODEs is x1' I _ I _ V1, Y F(X1,X2,V1,V2) 7 V2 where the vector F represents the right hand sides of the ODEs from problem #1. For case, we will write this as Y'(l) = F(Y(l)) At each time tn , the vector Yn contains the displacements and velocities. Heun's method would rst estimate YT," I Yn + h F (Yn) It would then produce a second, more accurate estimate using Yn+1 = Yn + hams) + F(Y:;+1)]- Run Heun's method for the system given in Problem #1. What is the maximum positive displacement achieved by mass 2 on the time interval [0, 20]? Problem #5: In a game of mini-golf, a golf ball with displacement x(t) that begins at x(0) = 0 is to be struck with just enough initial velocity x'(0) = V to stop at the top of a little hill. Because of the shape of the hill, the horizontal component of the force acting on the golf ball produces the ODE x" = 141 10 ( x - 5) e ( x - 5)2 The top of the hill is at x = 5. Write a program to find x(t) from two first order ODEs using Heun's method with step size h = 0.01 to determine the displacement of the golf ball over time. Put Heun's method into a "for" loop that will continue for 5000 time steps (so until t = 50), but have the loop break if x(t) becomes less than zero (the ball doesn't make it up the hill and rolls backward) or if x(t) becomes greater than 10 (the ball has gone past the top of the hill and is rolling away). Begin with a velocity V= 38. You should find that the "for" loop is broken at time t = 0.27. To find the velocity I that will have the golf ball stop at the top of the hill, you will use a bisection method. In the bisection method, you will keep trying new guesses for I that are half-way between a previous I that was too small (Vmin) and a previous I that was too large (Vmax). Begin with min = 0, and Vmax = 38 from above. Put the above "for" loop into a while loop that continues while Vmax - min is greater than 0.01. In each iteration, set I to the average of min and Vmax , run the above "for" loop, and check the result coming out of the "for" loop. If the final displacement of the ball is less than 5, update min to V, otherwise update Vmax to V. The code will then loop with a new guess halfway between the updated min and Vmax ("bisecting" the low and high estimates) until Vmin and Vmax are sufficiently close together. Enter the final values for Vmin and Vmax (in that order), separated with a comma

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 Mathematics Questions!