This file implements the functions of the Rosenbrock integration method in C. Specific functions implementation of the algorithm.
More...
This file implements the functions of the Rosenbrock integration method in C. Specific functions implementation of the algorithm.
Creation date: December 2017
- Author
- Olivier Lantsoght
Modification date: April 2018 \modified by Sebastien Timmermans
@source H. H. Rosenbrock, "Some general implicit processes for the numerical solution of differential equations", The Computer Journal (1963) 5(4): 329-330 Shampine, L.F. 1982, ACM Transactions on Mathematical Software, vol. 8, pp. 93Â113
(c) Universite catholique de Louvain
int rosenbrock |
( |
int |
n, |
|
|
int(*)(double, double[], double[], MbsData *, MbsDirdyn *) |
derivs, |
|
|
double * |
x, |
|
|
double |
y[], |
|
|
double |
eps, |
|
|
double |
hmax, |
|
|
double |
htry, |
|
|
long |
nmax, |
|
|
double |
dydx[], |
|
|
double |
yscal[], |
|
|
double * |
hnext, |
|
|
MbsData * |
s, |
|
|
MbsDirdyn * |
dd, |
|
|
double * |
hdid |
|
) |
| |
Fourth-order Rosenbrock step for integrating stiff problems, with monitoring of local truncation error to adjust stepsize.
Input are the dependent variable vector y[1..n] and its derivative dydx[1..n] at the starting value of the independent variable x. WARNING: this feature has not been heavily tested !
@source: H. H. Rosenbrock, "Some general implicit processes for the numerical solution of differential equations", The Computer Journal (1963) 5(4): 329-330 Shampine, L.F. 1982, ACM Transactions on Mathematical Software, vol. 8, pp. 93â113
- Parameters
-
n | Dimension of y |
derivs | The function computing f' |
x | Value of x |
y | Initial y values, index starting at 0 |
eps | The required accuracy |
hmax | The maximum stepsize allowed |
htry | The stepsize to be attempted |
nmax | The maximal number of allowed steps to reach tolerances |
dydx | Initial y derivative values, index starting at 0 |
yscal | The vector [0..n-1] against which the error is scaled, index starting at 0 |
hnext | The estimated next stepsize |
s | The MbsData structure of the model on which dirdyn analysis is computed. |
dd | The MbsDirdyn structure related to the integration. |
hdid | The stepsize that was actually accomplished |
- Returns
- error_code Return a negative number if something went wrong, 0 otherwise
calls an external function