function prikladyJednokrokoveMetody()

f = @(t,y) y; t0 = 0; u0 = 1; T = 10;

t = t0:0.01:T; y = u0*exp(t-t0); plot(t,y,'r')

h = 1; N = (T-t0)/h, [t,u] = doprednaEulerovaMetoda(f,u0,h,t0,N);
hold on; plot(t,u,'b')
h = 0.1; N = (T-t0)/h; [t,u] = doprednaEulerovaMetoda(f,u0,h,t0,N);
hold on; plot(t,u,'k')
h = 0.01; N = (T-t0)/h; [t,u] = doprednaEulerovaMetoda(f,u0,h,t0,N);
hold on; plot(t,u,'m')
h = 1; N = (T-t0)/h; [t,u] = HeuneovaMetoda(f,u0,h,t0,N);
hold on; plot(t,u,'b--')
h = 0.1; N = (T-t0)/h; [t,u] = HeuneovaMetoda(f,u0,h,t0,N);
hold on; plot(t,u,'k--')
pause
close all


f = @(t,y) (1+y.^2)./(t.*(1+t.^2).*y); t0 = 1; u0 = 1; T = 10;
close all
h = 1; N = (T-t0)/h, [t,u] = doprednaEulerovaMetoda(f,u0,h,t0,N);
plot(t,u,'b')
h = 0.1; N = (T-t0)/h, [t,u] = doprednaEulerovaMetoda(f,u0,h,t0,N);
hold on; plot(t,u,'k')
h = 0.01; N = (T-t0)/h, [t,u] = doprednaEulerovaMetoda(f,u0,h,t0,N);
hold on; plot(t,u,'r')
h = 2; N = (T-t0)/h, [t,u] = doprednaEulerovaMetoda(f,u0,h,t0,N);
h = 3; N = (T-t0)/h, [t,u] = doprednaEulerovaMetoda(f,u0,h,t0,N);
hold on; plot(t,u,'m')
h = 3; N = (T-t0)/h, [t,u] = zpetnaEulerovaMetoda(f,u0,h,t0,N);
hold on; plot(t,u,'m--')
h = 1; N = (T-t0)/h, [t,u] = zpetnaEulerovaMetoda(f,u0,h,t0,N);
hold on; plot(t,u,'b--')
h = 0.1; N = (T-t0)/h, [t,u] = zpetnaEulerovaMetoda(f,u0,h,t0,N);
hold on; plot(t,u,'k--')
h = 0.01; N = (T-t0)/h, [t,u] = zpetnaEulerovaMetoda(f,u0,h,t0,N);
hold on; plot(t,u,'r--')