utils.cpp File Reference
Detailed Description
Utility functions.
Definition in file utils.cpp.
#include "robot.h"
Include dependency graph for utils.cpp:
Go to the source code of this file.
|
Namespaces |
namespace | ROBOOP |
Defines |
#define | PGROW -0.20 |
#define | PSHRNK -0.25 |
#define | FCOR 0.06666666 |
#define | SAFETY 0.9 |
#define | ERRCON 6.0E-4 |
#define | MAXSTP 10000 |
#define | TINY 1.0e-30 |
Functions |
ReturnMatrix | x_prod_matrix (const ColumnVector &x) |
| Cross product matrix.
|
ReturnMatrix | Integ_Trap (const ColumnVector &present, ColumnVector &past, const Real dt) |
| Trapezoidal integration.
|
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) |
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.
|
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 | 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 | sign (const Matrix &x) |
| Sign of a matrix.
|
short | sign (const Real x) |
| Sign of real.
|
Variables |
static const char | rcsid [] = "$Id: utils.cpp,v 1.4 2004/07/14 02:32:12 ejt Exp $" |
| RCS/CVS version.
|
Define Documentation
Function Documentation
ReturnMatrix ROBOOP::Integ_Trap |
( |
const ColumnVector & |
present, |
|
|
ColumnVector & |
past, |
|
|
const Real |
dt |
|
) |
|
|
void ROBOOP::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 258 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 171 of file utils.cpp.
Referenced by ROBOOP::rkqc(). |
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 206 of file utils.cpp.
Referenced by ROBOOP::odeint(). |
void ROBOOP::Runge_Kutta4 |
( |
ReturnMatrix(*)(Real time, const Matrix &xin) |
xdot, |
|
|
const Matrix & |
xo, |
|
|
Real |
to, |
|
|
Real |
tf, |
|
|
int |
nsteps, |
|
|
RowVector & |
tout, |
|
|
Matrix & |
xout |
|
) |
|
|
|
Fixed step size fourth-order Runge-Kutta integrator.
Definition at line 143 of file utils.cpp. |
void Runge_Kutta4_Real_time |
( |
ReturnMatrix(*)(const Real time, const Matrix &xin) |
xdot, |
|
|
const Matrix & |
xo, |
|
|
const Real |
to, |
|
|
const Real |
tf, |
|
|
const int |
nsteps |
|
) |
|
|
void ROBOOP::Runge_Kutta4_Real_time |
( |
ReturnMatrix(*)(Real time, const Matrix &xin, bool &exit, bool &init) |
xdot, |
|
|
const Matrix & |
xo, |
|
|
Real |
to, |
|
|
Real |
tf, |
|
|
int |
nsteps |
|
) |
|
|
|
Fixed step size fourth-order Runge-Kutta integrator.
Definition at line 89 of file utils.cpp. |
short ROBOOP::sign |
( |
const Real |
x |
) |
|
|
ReturnMatrix ROBOOP::sign |
( |
const Matrix & |
x |
) |
|
|
ReturnMatrix ROBOOP::x_prod_matrix |
( |
const ColumnVector & |
x |
) |
|
|
Variable Documentation
const char rcsid[] = "$Id: utils.cpp,v 1.4 2004/07/14 02:32:12 ejt Exp $" [static] |
|
|
RCS/CVS version.
Definition at line 54 of file utils.cpp. |
|