%% 4 % Solve x'= x + 2y with x0=0,y'= x+ e^{-t}with y(0)=0

%% 4 % Work-out x'= x + 2y with x0=0,y'= x+ e^{-t}with y(0)=0 y0 = 0; % Initial Requisite h=0.1; % Time tramp t = 0:h:0.05; % t goes from 0 to 2 seconds. yexact = x+ e ** -t % Exact key (in public we will not perceive this ystar = zeros(size(t)); % Preallocate adorn (good-tempered coding exercitation) ystar(1) = y0; % Initial requisite gives key at t=0. restraint i=1:(length(t)-1) k1 = 1/9(2*e ** 2*t - 2*e** -t + 6^ e** -t) ; % Approx restraint y gives approx restraint deriv y1 = 1/9(e ** 2*t - e** -t + 6^t* e** -t);

% Included treasure k2 = x+2*y; % Approx deriv at included treasure. ystar(i+1) = x+e**-t; % Approach key at next treasure of y end