function [ x, y, t ] = RK2ndO_cpld1DE( t0, tN, N, x0, y0, f1, f2 )
%UNTITLED2 Summary of this function goes here
%   Detailed explanation goes here
t1=t0;
t=linspace(t1, tN, N);
dt=t(2)-t(1);

x(1)=x0; y(1)=y0;
for i=2:N
    % the first guess of the central point is done by
    % first order Euler
    xc=x(i-1)+(dt/2)*f1(x(i-1),y(i-1),t(i-1));
    yc=y(i-1)+(dt/2)*f2(x(i-1),y(i-1),t(i-1));
    
    x(i)=x(i-1)+dt* f1(xc,yc,t(i-1)+dt/2);
    y(i)=y(i-1)+dt* f2(xc,yc,t(i-1)+dt/2);
end

end

