I need to implement the 4th order Runge-Kutta method to propagate an affine non linear system. My doubt is in regards on how the input should be treated when calculating the k parameters. To be more specific, consider the affine non linear system $$\dot{y}(t)=f(t,y)+u(t)$$ where t is time, y is the output, u is the input and the derivative is with respect to time. The Runge Kutta parameter $k_{2}$ is given by $$k_{2}=f(t_{n}+\frac{h}{2}, y_{n}+h\frac{k_{1}}{2})$$ where h is the step length. Should the input be passed to the function as is, ie, simply as u thus resulting in the following equation for $k_{2}$? $$k_{2}=f(t_{n}+\frac{h}{2}, y_{n}+h\frac{k_{1}}{2})+u_{n}$$ I tried to search for related literature but couldn't find. If anyone can give me some links to related literature would be great.
Thanks in advanced.