
Tint = [0 2];
y0   = 0;

for i = 0:3
    for j = 0:4
        lambda = 10^i;
        dt     = 10^(-j);
        f = @(t,u) -lambda*(u-sin(pi*t)) + pi*cos(pi*t);
        [~,yEF] = EF(f,Tint,y0,dt);
        [~,yMP] = midpunt(f,Tint,y0,dt);
        [t,yRK] = odeRK4(f,Tint,y0,dt);
        emaxEF = max(abs(yEF - sin(pi*t)));
        emaxMP = max(abs(yMP - sin(pi*t)));
        emaxRK4= max(abs(yRK - sin(pi*t)));
        % plot(x,y,x,sin(pi*x));
        fprintf('lambda = %.2g and dt = %.2g, Error with, EF: %0.2d, MP: %0.2d, RK4: %0.2d \n',...
            lambda,dt,emaxEF,emaxMP,emaxRK4);
    end
end