Runge Kutta 4 integrator implementation Given values for the variables y[1..n] and their derivatives dydx[1..n] known at x, use the fourth-order Runge-Kutta method to advance the solution over an interval h and return the incremented variables as yout[1..n], which need not be a distinct array from y.
The user supplies the routine derivs(x,y,dydx), which returns derivatives dydx at x.
- Parameters
-
y | state vector of variable |
dydx | derivative of y by x |
n | number of variables |
x | current time value, at which the function needs to be computed |
h | time step |
yout | solution of the incremented variables |
derivs | The function computing f' |
s | the MbsData structure of the model on which dirdyn analysis is computed. |
dd | the MbsDirdyn structure related to the integration. |
- Returns
- Error status, <0 in case of failure.