SurgSim::Math::OdeEquation Class Referenceabstract

Ode equation of 2nd order of the form M(x,v).a = F(x, v) with (x0, v0) for initial conditions and a set of boundary conditions. More...

#include <SurgSim/Math/OdeEquation.h>

Inheritance diagram for SurgSim::Math::OdeEquation:
[legend]

## Public Member Functions

virtual ~OdeEquation ()
Virtual destructor. More...

const std::shared_ptr< OdeStategetInitialState () const
Retrieves the ode initial conditions (x0, v0) (i.e. More...

virtual VectorcomputeF (const OdeState &state)=0
Evaluation of the RHS function f(x,v) for a given state. More...

virtual const MatrixcomputeM (const OdeState &state)=0
Evaluation of the LHS matrix M(x,v) for a given state. More...

virtual const MatrixcomputeD (const OdeState &state)=0
Evaluation of D = -df/dv (x,v) for a given state. More...

virtual const MatrixcomputeK (const OdeState &state)=0
Evaluation of K = -df/dx (x,v) for a given state. More...

virtual void computeFMDK (const OdeState &state, Vector **f, Matrix **M, Matrix **D, Matrix **K)=0
Evaluation of f(x,v), M(x,v), D = -df/dv(x,v), K = -df/dx(x,v) When all the terms are needed, this method can perform optimization in evaluating everything together. More...

## Protected Attributes

std::shared_ptr< OdeStatem_initialState
The initial state (which defines the ODE initial conditions (x0, v0)) More...

## Detailed Description

Ode equation of 2nd order of the form M(x,v).a = F(x, v) with (x0, v0) for initial conditions and a set of boundary conditions.

The problem is called a Boundary Value Problem (BVP).

Note
This ode equation is solved as an ode of order 1 by defining the state vector y = (x v)^t:
y' = ( x' ) = ( dx/dt ) = ( v )
( v' ) = ( dv/dt ) = ( M(x, v)^{-1}.F(x, v) )
To allow the use of explicit and implicit solver, we need to be able to evaluate
M(x,v), F(x,v) but also K = -dF/dx(x,v), D = -dF/dv(x,v)
Models wanting the use of implicit solvers will need to compute these Jacobian matrices.

## Constructor & Destructor Documentation

 virtual SurgSim::Math::OdeEquation::~OdeEquation ( )
inlinevirtual

Virtual destructor.

## Member Function Documentation

 virtual const Matrix& SurgSim::Math::OdeEquation::computeD ( const OdeState & state )
pure virtual

Evaluation of D = -df/dv (x,v) for a given state.

Parameters
 state (x, v) the current position and velocity to evaluate the Jacobian matrix with
Returns
The matrix D = -df/dv(x,v)
Note
Returns a reference, its values will remain unchanged until the next call to computeD() or computeFMDK()

Implemented in SurgSim::Physics::MassSpringRepresentation, and SurgSim::Physics::FemRepresentation.

 virtual Vector& SurgSim::Math::OdeEquation::computeF ( const OdeState & state )
pure virtual

Evaluation of the RHS function f(x,v) for a given state.

Parameters
 state (x, v) the current position and velocity to evaluate the function f(x,v) with
Returns
The vector containing f(x,v)
Note
Returns a reference, its values will remain unchanged until the next call to computeF() or computeFMDK()

Implemented in SurgSim::Physics::MassSpringRepresentation, and SurgSim::Physics::FemRepresentation.

 virtual void SurgSim::Math::OdeEquation::computeFMDK ( const OdeState & state, Vector ** f, Matrix ** M, Matrix ** D, Matrix ** K )
pure virtual

Evaluation of f(x,v), M(x,v), D = -df/dv(x,v), K = -df/dx(x,v) When all the terms are needed, this method can perform optimization in evaluating everything together.

Parameters
 state (x, v) the current position and velocity to evaluate the various terms with [out] f The RHS f(x,v) [out] M The matrix M(x,v) [out] D The matrix D = -df/dv(x,v) [out] K The matrix K = -df/dx(x,v)
Note
Returns pointers, the internal data will remain unchanged until the next call to computeFMDK() or
computeF(), computeM(), computeD(), computeK()

Implemented in SurgSim::Physics::MassSpringRepresentation, and SurgSim::Physics::FemRepresentation.

 virtual const Matrix& SurgSim::Math::OdeEquation::computeK ( const OdeState & state )
pure virtual

Evaluation of K = -df/dx (x,v) for a given state.

Parameters
 state (x, v) the current position and velocity to evaluate the Jacobian matrix with
Returns
The matrix K = -df/dx(x,v)
Note
Returns a reference, its values will remain unchanged until the next call to computeK() or computeFMDK()

Implemented in SurgSim::Physics::MassSpringRepresentation, and SurgSim::Physics::FemRepresentation.

 virtual const Matrix& SurgSim::Math::OdeEquation::computeM ( const OdeState & state )
pure virtual

Evaluation of the LHS matrix M(x,v) for a given state.

Parameters
 state (x, v) the current position and velocity to evaluate the matrix M(x,v) with
Returns
The matrix M(x,v)
Note
Returns a reference, its values will remain unchanged until the next call to computeM() or computeFMDK()

Implemented in SurgSim::Physics::MassSpringRepresentation, and SurgSim::Physics::FemRepresentation.

 const std::shared_ptr< OdeState > SurgSim::Math::OdeEquation::getInitialState ( ) const

Retrieves the ode initial conditions (x0, v0) (i.e.

the initial state)

Returns
The initial state

## Member Data Documentation

 std::shared_ptr SurgSim::Math::OdeEquation::m_initialState
protected

The initial state (which defines the ODE initial conditions (x0, v0))

Note
MUST be set by the derived classes

The documentation for this class was generated from the following files: