Homepage Demos Overview Downloads Tutorials Reference
Credits

utils.cpp File Reference


Detailed Description

Utility functions.

Definition in file utils.cpp.

#include "robot.h"

Include dependency graph for utils.cpp:

Include dependency graph

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

const char rcsid [] = "$Id: utils.cpp,v 1.4 2004/07/14 02:32:12 ejt Exp $"
 RCS/CVS version.


Define Documentation

#define ERRCON   6.0E-4
 

Definition at line 204 of file utils.cpp.

Referenced by ROBOOP::rkqc().

#define FCOR   0.06666666
 

Definition at line 202 of file utils.cpp.

#define MAXSTP   10000
 

Definition at line 255 of file utils.cpp.

#define PGROW   -0.20
 

Definition at line 200 of file utils.cpp.

Referenced by ROBOOP::rkqc().

#define PSHRNK   -0.25
 

Definition at line 201 of file utils.cpp.

Referenced by ROBOOP::rkqc().

#define SAFETY   0.9
 

Definition at line 203 of file utils.cpp.

Referenced by ROBOOP::rkqc().

#define TINY   1.0e-30
 

Definition at line 256 of file utils.cpp.


Function Documentation

ReturnMatrix ROBOOP::Integ_Trap const ColumnVector &  present,
ColumnVector &  past,
const Real  dt
 

Trapezoidal integration.

Definition at line 76 of file utils.cpp.

Referenced by ROBOOP::Impedance::control(), and ROBOOP::Clik::q_qdot().

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
 

Definition at line 118 of file utils.cpp.

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  ) 
 

Sign of real.

Definition at line 336 of file utils.cpp.

ReturnMatrix ROBOOP::sign const Matrix &  x  ) 
 

Sign of a matrix.

Definition at line 317 of file utils.cpp.

Referenced by ROBOOP::mRobot_min_para::C(), ROBOOP::mRobot::C(), ROBOOP::Robot::C(), ROBOOP::mRobot_min_para::torque(), ROBOOP::mRobot::torque(), and ROBOOP::Robot::torque().

ReturnMatrix ROBOOP::x_prod_matrix const ColumnVector &  x  ) 
 

Cross product matrix.

Definition at line 64 of file utils.cpp.

Referenced by ROBOOP::Quaternion::E(), ROBOOP::Clik::endeff_pos_ori_err(), ROBOOP::Quaternion::R(), ROBOOP::Quaternion::T(), and ROBOOP::Resolved_acc::torque_cmd().


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.


ROBOOP v1.21a
Generated Tue Nov 23 16:35:54 2004 by Doxygen 1.3.9.1