Question: THIS IS A MATLAB ASSIGNMENT. NEED TO KNOW HOW TO WORK THIS ON MATLAB. Question 1: Apply the Euler method to solve (t+1)y2 dy =
THIS IS A MATLAB ASSIGNMENT. NEED TO KNOW HOW TO WORK THIS ON MATLAB.
Question 1: Apply the Euler method to solve (t+1)y2 dy = 8y dtt +1 y(0) = 1 from t = 0 to t=5. Your code should use a function, just as in the code I used to find z(t) in the most recent section. Modify the above code (using a function f) so that it solves this ODE Note that this problem has exact solution y(t) = 10(t+1) (+ 1) 10 + 9 Then do the following: Figure out what is the minimum value of n that you need such that the maximum error is smaller than 0.01. Do this by experimenting with N until you get a small enough error. Plot the computed and exact solution using this value of N. Show the method is approximately second order by doubling N and computing the ratio of the errors. Doing so may require a much larger value of N, especially in the two further questions below. You should find that the solution has exactly one local maximum. y(tmax) = Ymax Use the max function to find approximations to both tmax and ymax - To do this, you need to call the function with two output arguments. Look at the help for the function max by typing doc max at the Matlab >> prompt. Print out these values and, if possible, plot this point with a marker on your plot of y(t). You should hand in a printout of your code, any figures you print, and a report of a few sentences answering all the questions Question 1: Apply the Euler method to solve (t+1)y2 dy = 8y dtt +1 y(0) = 1 from t = 0 to t=5. Your code should use a function, just as in the code I used to find z(t) in the most recent section. Modify the above code (using a function f) so that it solves this ODE Note that this problem has exact solution y(t) = 10(t+1) (+ 1) 10 + 9 Then do the following: Figure out what is the minimum value of n that you need such that the maximum error is smaller than 0.01. Do this by experimenting with N until you get a small enough error. Plot the computed and exact solution using this value of N. Show the method is approximately second order by doubling N and computing the ratio of the errors. Doing so may require a much larger value of N, especially in the two further questions below. You should find that the solution has exactly one local maximum. y(tmax) = Ymax Use the max function to find approximations to both tmax and ymax - To do this, you need to call the function with two output arguments. Look at the help for the function max by typing doc max at the Matlab >> prompt. Print out these values and, if possible, plot this point with a marker on your plot of y(t). You should hand in a printout of your code, any figures you print, and a report of a few sentences answering all the questions
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
