[Solved]Function Name Oiler Inputs 1 Double 2xn Set X Y Data 2 Double 1×2 Starting Point 3 Double Q37118585
***USE MATLAB ONLY***
Function Name: oiler Inputs: 1. (double) 2xN set of x and y’ data 2. (double) 1×2 starting point 3. (double) x-goal Outputs: 1. (double) y-goal Background You are a NASCAR data analyst who wants to create simulations of various races Unfortunately, your department is severely underfunded due to no one caring about your life’s passion. All you have at your disposal is speed data from the cars, a few snippets of video footage, and (of course) MATLAB. You know you can make your dream come true! Function Description: The goal of this problem is to find the y-value of a new point, using only information about the derivative, a starting point, and the x-value of the final point. This will be accomplished through Euler’s method. Euler’s method iterates from a starting point in steps of a certain size At each point along the way it calculates the y value at the next point by adding the current y value to the derivative times the step size. Use the following steps to implement Euler’s method 1. Using the x-coordinate of the start and end points, determine if you will need a step size of 0.1 or -0.1. The step will be -0.1 if the x-coordinate of the goal is less than the x-coordinate of the starting point and 0.1 if it is greater than the starting point. Find the value of the derivative at the current x-coordinate using spline interpolation on the data provided in the first input. The first row of the first input is the x data and the second row is the y data corresponding to each x point Apply the following formula to find the y-value of the next point: 2. 3. n+1 4. Apply the following formula to find the x-value of the next point: nt 5. Repeat steps 2-4 until you reach the ending x-value, given by the third input Your output will be the y-value at the ending point, rounded to 4 decimal places. Once you have all the new y values calculated at each iteration, plot them using a solid blue line with blue stars on each point. Set the axis for this plot to equal. Show transcribed image text Function Name: oiler Inputs: 1. (double) 2xN set of x and y’ data 2. (double) 1×2 starting point 3. (double) x-goal Outputs: 1. (double) y-goal Background You are a NASCAR data analyst who wants to create simulations of various races Unfortunately, your department is severely underfunded due to no one caring about your life’s passion. All you have at your disposal is speed data from the cars, a few snippets of video footage, and (of course) MATLAB. You know you can make your dream come true! Function Description: The goal of this problem is to find the y-value of a new point, using only information about the derivative, a starting point, and the x-value of the final point. This will be accomplished through Euler’s method. Euler’s method iterates from a starting point in steps of a certain size At each point along the way it calculates the y value at the next point by adding the current y value to the derivative times the step size. Use the following steps to implement Euler’s method 1. Using the x-coordinate of the start and end points, determine if you will need a step size of 0.1 or -0.1. The step will be -0.1 if the x-coordinate of the goal is less than the x-coordinate of the starting point and 0.1 if it is greater than the starting point. Find the value of the derivative at the current x-coordinate using spline interpolation on the data provided in the first input. The first row of the first input is the x data and the second row is the y data corresponding to each x point Apply the following formula to find the y-value of the next point: 2. 3. n+1 4. Apply the following formula to find the x-value of the next point: nt 5. Repeat steps 2-4 until you reach the ending x-value, given by the third input Your output will be the y-value at the ending point, rounded to 4 decimal places. Once you have all the new y values calculated at each iteration, plot them using a solid blue line with blue stars on each point. Set the axis for this plot to equal.
Expert Answer
Answer to Function Name: oiler Inputs: 1. (double) 2xN set of x and y’ data 2. (double) 1×2 starting point 3. (double) x-goal Outp… . . .
OR

