%Metodo de RK3 com extrapolacao de Richardson

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

    x1 = RK3(t0,tf,h,x0,F);
    x2 = RK3(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) = (8*x2(2*i-1)-x1(i))/7;
    end
end