Defines |
#define | ERRCON 6.0E-4 |
#define | FCOR 0.06666666 |
#define | MAXSTP 10000 |
#define | PGROW -0.20 |
#define | PSHRNK -0.25 |
#define | SAFETY 0.9 |
#define | TINY 1.0e-30 |
Functions |
ReturnMatrix | Integ_Trap (const ColumnVector &present, ColumnVector &past, const Real dt) |
| Trapezoidal integration.
|
void | odeint (ReturnMatrix(*xdot)(Real time, const Matrix &xin), Matrix &xo, Real to, Real tf, Real eps, Real h1, Real hmin, int &nok, int &nbad, RowVector &tout, Matrix &xout, Real dtsav) |
| Integrate the ordinary differential equation xdot from time to to time tf using an adaptive step size strategy.
|
ReturnMatrix | pinv (const Matrix &M) |
| Matrix pseudo inverse using SVD.
|
ReturnMatrix | rk4 (const Matrix &x, const Matrix &dxdt, Real t, Real h, ReturnMatrix(*xdot)(Real time, const Matrix &xin)) |
| Compute one Runge-Kutta fourth order step.
|
void | rkqc (Matrix &x, Matrix &dxdt, Real &t, Real htry, Real eps, Matrix &xscal, Real &hdid, Real &hnext, ReturnMatrix(*xdot)(Real time, const Matrix &xin)) |
| Compute one adaptive step based on two rk4.
|
void | Runge_Kutta4 (ReturnMatrix(*xdot)(Real time, const Matrix &xin), const Matrix &xo, Real to, Real tf, int nsteps, RowVector &tout, Matrix &xout) |
| Fixed step size fourth-order Runge-Kutta integrator.
|
void | Runge_Kutta4_Real_time (ReturnMatrix(*xdot)(Real time, const Matrix &xin, bool &exit, bool &init), const Matrix &xo, Real to, Real tf, int nsteps) |
| Fixed step size fourth-order Runge-Kutta integrator.
|
void | Runge_Kutta4_Real_time (ReturnMatrix(*xdot)(const Real time, const Matrix &xin), const Matrix &xo, const Real to, const Real tf, const int nsteps) |
ReturnMatrix | sign (const Matrix &x) |
| Sign of a matrix.
|
short | sign (const Real x) |
| Sign of real.
|
ReturnMatrix | x_prod_matrix (const ColumnVector &x) |
| Cross product matrix.
|
Variables |
static const char | rcsid [] = "$Id: utils.cpp,v 1.26 2006/05/16 16:11:15 gourdeau Exp $" |
| RCS/CVS version.
|
void odeint |
( |
ReturnMatrix(*)(Real time, const Matrix &xin) |
xdot, |
|
|
Matrix & |
xo, |
|
|
Real |
to, |
|
|
Real |
tf, |
|
|
Real |
eps, |
|
|
Real |
h1, |
|
|
Real |
hmin, |
|
|
int & |
nok, |
|
|
int & |
nbad, |
|
|
RowVector & |
tout, |
|
|
Matrix & |
xout, |
|
|
Real |
dtsav |
|
) |
| |
Integrate the ordinary differential equation xdot from time to to time tf using an adaptive step size strategy.
adapted from: Numerical Recipes in C, The Art of Scientific Computing, Press, William H. and Flannery, Brian P. and Teukolsky, Saul A. and Vetterling, William T., Cambridge University Press, 1988.
Definition at line 347 of file utils.cpp.
ReturnMatrix rk4 |
( |
const Matrix & |
x, |
|
|
const Matrix & |
dxdt, |
|
|
Real |
t, |
|
|
Real |
h, |
|
|
ReturnMatrix(*)(Real time, const Matrix &xin) |
xdot |
|
) |
| |
Compute one Runge-Kutta fourth order step.
adapted from: Numerical Recipes in C, The Art of Scientific Computing, Press, William H. and Flannery, Brian P. and Teukolsky, Saul A. and Vetterling, William T., Cambridge University Press, 1988.
Definition at line 260 of file utils.cpp.
void rkqc |
( |
Matrix & |
x, |
|
|
Matrix & |
dxdt, |
|
|
Real & |
t, |
|
|
Real |
htry, |
|
|
Real |
eps, |
|
|
Matrix & |
xscal, |
|
|
Real & |
hdid, |
|
|
Real & |
hnext, |
|
|
ReturnMatrix(*)(Real time, const Matrix &xin) |
xdot |
|
) |
| |
Compute one adaptive step based on two rk4.
adapted from: Numerical Recipes in C, The Art of Scientific Computing, Press, William H. and Flannery, Brian P. and Teukolsky, Saul A. and Vetterling, William T., Cambridge University Press, 1988.
Definition at line 295 of file utils.cpp.