clear all
A = [-1,0;0,-100];
tstar = 40;
tsrange = 500:100:2500;
counter = 0;
for ts = tsrange
  counter = counter+1;
  k = tstar/ts;  
  y0 = [1;1];
  yee = y0;
  yei = y0;
  for n = 1:ts
    yee = yee+k*A*yee;
    yei = (eye(2)-k*A)\yei;
  end
  erree(counter) = norm(yee-[exp(-tstar);exp(-100*tstar)],inf);
  errei(counter) = norm(yei-[exp(-tstar);exp(-100*tstar)],inf);
end
loglog(tsrange,erree,'o',tsrange,errei,'*')
legend('Eulero esplicito','Eulero implicito')
xlabel('m')
ylabel('absolute error')