Question: For the following first order ODE, dy dt = y + t for t= 0 to t = 1.5 with the initial value of
For the following first order ODE, dy dt = y + t for t= 0 to t = 1.5 with the initial value of y(0) = 1. This ODE has the analytical solution, y = 7et t-3t-6t-6 Write a MATLAB script to do the following, (a) (4m) Use the function odeEuler to solve using the first order Euler explicit method using h = 0.5. (b) (4m) Write a MATLAB function called odeMidPoint to solve the ODE using the second order mid-point method using h = 0.5. Call this function from your script to solve the ODE. (c) (1m) Use the function odeRK4 to solve using the classical fourth-order Runge-Kutta method using h = 0.5. (d) (3m) Plot the four solutions on a single annotated graph using different markers/colours for the different solutions. (e) (3m) For each method, calculate the mean relative error and the approximate number of accurate digits.
Step by Step Solution
3.26 Rating (152 Votes )
There are 3 Steps involved in it
Given below are the codes and screenshots of the for the functions odeEuler odeMidPoint odeRK4 function ty odeEulerfIy0h ODEEULER Computes the solutio... View full answer
Get step-by-step solutions from verified subject matter experts
