2) Please write this in MATLAB, thank you!!!
Problem 2: Backward Euler's method + FPI
In this problem,you will create a function that will implement backward Euler's method by solving (approximately) a fixed-point problem at every step
The backward Euler's method for the Initial Value Problem (IVP) y=f(t,y), q>7> is defined as ly(a) = Ya
Wo =Ya Wi+1 =Wi+hfti+1,Wi+1
i=0...,n-1
Thus, Wi+1 solves the fixed point problem ()= , where x=wi+hfti+1,x
On a separate file,write the function with definition
function [w] = bwdEulerFPI(f, a, b, ya, h, tol)
with input
the source term of the 1-st order scalar ODE f(t,y) function of two variables
a,b the left and right boundary of the domain of t
respectively ya the initial value Ya h the timestep tol the tolerance to be used for the fixed-point iteration at
every step;evaluate Wi+1 as the approximate solution to the fixed-point problem described above
with initial guess w; and stopping condition x-xk<to1
and output
w the vector of backward Euler method's approximations to{yi}=owithw;~yi=yti),i=0,1...,n
In your prob2 function
a.Call bwdEulerFPI for the IVP y =cos(t+y, I>>0 with h =0.01,to1=10-6 l y(0) =0 b. Present a figure with your backward Euler approximation. In the same figure, plot the exact solution of the IVP,y(t)=2 arctan(t) - t. c.Add a legend to the figure