MATLAB Code:
close all
clear
clc
x0 = 1;
y0 = 1; % y(1) and y1 = y(1.2)
h = 0.2;
x1 = x0 + h;
f = @(x,y) cos(x*y);
eqn = @(y1) y1 - ( y0 + (h/2) * (f(x0,y0) + f(x1,y1)) ); % eqn.
that needs to be solved
y1 = fsolve(eqn, 0); % with initial guess of y1 = 0
disp('y(1.2) ='), disp(y1)
Output:
y(1.2) =
1.0810
i need the code for this question please 3. Constler the folloving nitial valse proble dy Take one stop of the modified Euler8 nelloul Un+,-di +습 (J(z",la) + f(m+1 lat)) with h 0.2 o find t...