1. Write a user defined function euler(f, a, b, N, α) that outputs a vector w = (wi) = (w0, w1, . . . , wN ) of Euler approximations at the points tᵢ
2. Consider the IVP below
--- = 3t − --- 1 ≤ t ≤ 6
x(1) = 2
The solution to this IVP is x(t) = t² + 1/t.
(a) Determine the rate of convergence to its solution (demonstrate numerically) using the classical Runge-Kutta scheme
(b) Approximate the solution using your euler function with stepsize h = .02 and RK4 with stepsizes h = .02 and h = .2. Plot the solution function and these three approximations on one figure. Any observations?
(c) Determine the rate of convergence to its solution (demonstrate numerically)using the classical Runge-Kutta scheme if the initial value is x(1) = 1 instead. The exact solution in this case is x(t) = t²
(d) Is there a difference in the rate of convergence? If so, explain why that might be.
This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.function [t, w] = euler( f,a,b,N,alpha )
%[ w] = euler( f,a,b,N,alpha )
% f -- function f(t,x)
% a -- begin point interval
% b -- end points interval
% N -- number of steps
% alpha -- initial condition x(a)
% t -- the vector of times t_i
% w -- the vector of solutions at the times t_i