This project introduces approximations to Ordinary Differential Equations using numerical methods. You will program three numerical solvers: Euler's method, Improved Euler's method, and 4th order Runge-Kutta (RK4). You are required to write your own numerical methods in either MATLAB or MS Excel. You are not allowed to use numerical solvers written by anyone else.
Problem 1: Consider the following Initial Value Problem (IVP) where y is the dependent variable and t is the independent variable: y' = sin(t) * (1 - y) with y(0) = y0 and t ≥ 0
Note: the analytic solution for this IVP is: y(t) = 1 + (y0 - 1)e^cos(t) - 1
Part 1A: Approximate the solution to the IVP using Euler's method with the following conditions: Initial condition y0 = -1/2; time step h = 1/16; and time interval t ∈ [0,20]
+ Derive the recursive formula for Euler's method applied to this IVP
+ Plot the Euler's method approximation
+ Plot the absolute error between the approximation and the exact solution using a semilog plot
Part 1B: Approximate the solution to the IVP using the Improved Euler's method with the following conditions: Initial condition y0 = -1/2; time step h = 1/16; and time interval t ∈ [0,20]
+ Derive the recursive formula for the Improved Euler's method applied to this IVP
+ Plot the Improved Euler's method approximation
+ Plot the absolute error between the approximation and the exact solution using a semilog plot
Part 1C: Approximate the solution to the IVP using the RK4 method with the following conditions: Initial condition y0 = -1/2; time step h = 1/16; and time interval t ∈ [0,20]
+ Plot the RK4 method approximation
+ Plot the absolute error between the approximation and the exact solution using a semilog plot
Problem 2: Consider the following Initial Value Problem (IVP) where y(t) is the dependent function: y' = y - y^2 + 1.14 cos(et/2) with y(0) = y0 and t ≥ 0
Part 2A: Approximate the solution to the IVP using the Improved Euler's method with the following conditions: Initial condition y0 = 1; time steps h = 1/8, 1/16, 1/32, 1/64; and time interval t ∈ [0,20]
+ Plot the Improved Euler's method approximation for all 4 time steps
+ Discuss the results of these approximations
Part 2B: Approximate the solution to the IVP using the RK4 method with the following conditions: Initial condition y0 = 1; time steps h = 1/8, 1/16, 1/32, 1/64; and time interval t ∈ [0,20]
+ Plot the RK4 approximation for all 4 time steps
+ Discuss the results of these approximations