Question: Comparing Different Solvers (20 pts) Write a MATLAB script to solve problem 25.1 below. Name your script a4task3.m. You may create additional functions to support
Comparing Different Solvers (20 pts) Write a MATLAB script to solve problem 25.1 below. Name your script a4task3.m. You may create additional functions to support your script if you like (e.g., create a function for each solver, which would make the code easier to manage than having one giant file), but if you do so you must make sure to upload them to eCampus along with the required script. Your script should generate the graph requested in the problem with each curve labeled using the legend command. Save the graph as a file named a4task3.fig (do this by going to file->save as in the figure window). The script should execute properly when run from a cleared workspace. It should display nothing to the command window and not include the commands clear or close (you may use these, but please comment them out prior to submitting your code). Since there are five curves (analytical solution, two for Eulers method, and one each for midpoint and RK4 methods) that you need to generate, scoring will be 4 points per correct curve.
25.1 Solve the following initial value problem over the interval fronm t 0 to 2 where y(0 1. Display all your results on the same graph. dy1.5y (a) Analytically. (b) Euler's method with h0.5 and 0.25. (c) Midpoint method with h 0.5. (d) Fourth-order RK method with h 0.5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
