function xNew = multi_RK2(nSteps, t, x, tau) tau1 = tau/nSteps; xVec = zeros(2*nSteps+1,1); tVec = t + tau1/2*(0:2*nSteps); xVec(1) = x; xVec(2) = x + tau1/2*f_Extrap(t,x); for i = 3:2*nSteps+1 xVec(i) = psi_RK2( tVec(i-2), xVec(i-2), xVec(i-1), tau1 ); end xNew = xVec(end);