%Metodo de RK4 com extrapolacao de Richardson

function x = RK4_Richardson(t0,tf,h,x0,F)

    x1 = RK4(t0,tf,h,x0,F);
    x2 = RK4(t0,tf,h/2,x0,F);
    for i=1:length(x1)
% Richardson: x(t_n)=(2^p x_{2n}(h/2)- x_n(h))/(2^p-1) + O(h^{p+1})
      x(i) = (16*x2(2*i-1)-x1(i))/15;
    end
end