MechanicalDAEIntegrator Class Reference

#include <NumericalMethods.h>

Inheritance diagram for MechanicalDAEIntegrator:

OLDCPodesIntegrator OLDExplicitEuler OLDRungeKuttaMerson

List of all members.


Detailed Description

This interface is to be implemented whenever you want to treat your mechanical system as a DAE to be solved with coordinate projection.

In this formulation, we expect to compute state derivatives directly by embedding the acceleration-level constraints, forming an ODE. We integrate this system using an ordinary ODE method, but then the solution will violate position and velocity constraints. The coordinate projection scheme moves the solution back onto the constraint manifold. Typically there is a lot of exploitable structure to the constraints so we expect the user function here to be capable of performing the projection itself, resulting in a *small* change to the state. If the calling ODE solver is a multistep method which must retain past solution values, it needs to update its internal solution memory using the *projected* result.

The state y is internally partitioned into three segments: y = {q,u,z) although the caller does not need to know about this partioning. The q's are configuration coordinates and participate in all the constraints. u's are velocity coordinates (the qdots are some linear function of the u's) and participate in velocity constraints. z's are "dynamic" state variables typically associated with forces and are not involved in any of the constraints (TODO: we could add dynamic constraints as well).

The system of equations represented here is: ydot=f(t,y) derivative function perr=p(t,q) position constraint errors verr=v(t,q,u) velocity constraint errors

Scaling ------- In internal coordinates, different state variable can be expected to have very different scales. We expect the system here to understand the scaling of each of its state variables. That is, it should be able to provide "units" ui for each yi in y. Unit ui (>0) is the amount we would consider a "unit" change in yi, measuring about its current value. NOTE: "unit" here does not mean "small"! These units are intended as a statement about the model, not the numerical solution, so they are independent of the requested integration accuracy. The default unit is 1 which would treat all variables as equally important. Also we expect to know for each variable whether it is appropriate to use relative tolerance on that variable. Angles, for example, are periodic so the accuracy requirement is independent of the current value which may have "wrapped" many times. We'll define ri=1 if relative error is OK, ri=0 if not.

Given this knowledge, we expect the system to implement a method which, given a scalar relative tolerance rtol and absolute tolerance atol, can return a multiplicative weighting to be applied to estimated state errors, such that a resulting WRMS norm <= 1 would indicate that the requested tolerances had been achieved.

If an integrator solution is being performed with relative tolerance rtol and absolute tolerance atol, then the weight for an error in yi is Wi = 1/(ri*rtol*|yi| + ui*atol)

Constraint tolerances --------------------- We do not expect to project constraints every step, since the ODE automatically satisfies them at the acceleration level. However, we do need to project them if they have drifted too far, and the acceptable drift depends on user-requested accuracy. As for scaling of the state variables, we expect the model to understand the units for each constraint violation, so that a "unit" change in any constraint would be considered equally as egregious as a "unit" change in any other. Again note that "unit" does not mean small. Typical choices for a translational constraint might be meters for large systems and nanometers for molecules and in both cases one might consider 0.001 unit to be a "small" violation (a millimeter or hundredth of an Angstrom). Velocity constraints do not need separate units, but they require a notion of timescale. That is, what do you consider a significant amount of time? Call that time ts; then a "unit" velocity constraint error is that velocity which would result in a unit position error after a time ts.

With the constraint units and timescale known, we are given a single scalar constraint tolerance which is interpreted as the maximum number of units of error we can tolerate in any constraint. If the current constraint violations are each smaller than that (in their own units) then we won't project for that step. When we do project, the projection should be done so as to reduce the violations substantially. Abstract Index3 DAE Integrator using the Coordinate Projection method. We expect this to be able to take a single, error-controlled step advancing the solution y(t) to a DAE initial value problem of the form y' = f(t,y) 0 = c(t,y) constraints (position & velocity)

y(t0) = y0 initial conditions c(t0,y0) = 0

We expect to be given a DAE System to integrate which can calculate the derivatives from the state and perform the necessary projections to solve c(t,y)=0.

In general an integrator will maintain a complex internal state which must be allocated when the problem size is known.

Public Member Functions

 MechanicalDAEIntegrator (const MultibodySystem &mb, State &s)
virtual ~MechanicalDAEIntegrator ()
const MultibodySystemgetMultibodySystem () const
const StategetState () const
StateupdState ()
virtual MechanicalDAEIntegratorclone () const =0
virtual bool initialize ()=0
virtual bool step (const Real &tout)=0
virtual Real getConstraintTolerance () const =0
void setStopTime (const Real &tstop)
void setInitialStepSize (const Real &z)
void setMinimumStepSize (const Real &z)
void setMaximumStepSize (const Real &z)
void setAccuracy (const Real &accuracy)
void setRelativeTolerance (const Real &relTol)
void setAbsoluteTolerance (const Real &absTol)
void setConstraintTolerance (const Real &consTol)
void setVelocityConstraintRescale (const Real &rescale)
void setProjectEveryStep (bool forceProject)
long getStepsAttempted () const
long getStepsTaken () const
long getErrorTestFailures () const
long getRealizeFailures () const
long getProjectionFailures () const
long getStepSizeChanges () const

Protected Member Functions

void initializeUserStuff ()
void zeroStats ()

Protected Attributes

const MultibodySystemmbs
Statestate
Real userInitStepSize
Real userMinStepSize
Real userMaxStepSize
Real userAccuracy
Real userRelTol
Real userAbsTol
Real userConsTol
Real userVConsRescale
Real userStopTime
long userMaxNumSteps
int userProjectEveryStep
long statsStepsAttempted
long statsStepsTaken
long statsErrorTestFailures
long statsRealizationFailures
long statsProjectionFailures
long statsStepSizeChanges


Constructor & Destructor Documentation

MechanicalDAEIntegrator ( const MultibodySystem mb,
State s 
) [inline, explicit]

virtual ~MechanicalDAEIntegrator (  )  [inline, virtual]


Member Function Documentation

const MultibodySystem& getMultibodySystem (  )  const [inline]

const State& getState (  )  const [inline]

State& updState (  )  [inline]

virtual MechanicalDAEIntegrator* clone (  )  const [pure virtual]

virtual bool initialize (  )  [pure virtual]

virtual bool step ( const Real &  tout  )  [pure virtual]

virtual Real getConstraintTolerance (  )  const [pure virtual]

void setStopTime ( const Real &  tstop  )  [inline]

void setInitialStepSize ( const Real &  z  )  [inline]

void setMinimumStepSize ( const Real &  z  )  [inline]

void setMaximumStepSize ( const Real &  z  )  [inline]

void setAccuracy ( const Real &  accuracy  )  [inline]

void setRelativeTolerance ( const Real &  relTol  )  [inline]

void setAbsoluteTolerance ( const Real &  absTol  )  [inline]

void setConstraintTolerance ( const Real &  consTol  )  [inline]

void setVelocityConstraintRescale ( const Real &  rescale  )  [inline]

void setProjectEveryStep ( bool  forceProject  )  [inline]

long getStepsAttempted (  )  const [inline]

long getStepsTaken (  )  const [inline]

long getErrorTestFailures (  )  const [inline]

long getRealizeFailures (  )  const [inline]

long getProjectionFailures (  )  const [inline]

long getStepSizeChanges (  )  const [inline]

void initializeUserStuff (  )  [inline, protected]

void zeroStats (  )  [inline, protected]


Member Data Documentation

const MultibodySystem& mbs [protected]

State& state [protected]

Real userInitStepSize [protected]

Real userMinStepSize [protected]

Real userMaxStepSize [protected]

Real userAccuracy [protected]

Real userRelTol [protected]

Real userAbsTol [protected]

Real userConsTol [protected]

Real userVConsRescale [protected]

Real userStopTime [protected]

long userMaxNumSteps [protected]

int userProjectEveryStep [protected]

long statsStepsAttempted [protected]

long statsStepsTaken [protected]

long statsErrorTestFailures [protected]

long statsRealizationFailures [protected]

long statsProjectionFailures [protected]

long statsStepSizeChanges [protected]


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

Generated on Fri Sep 26 07:44:32 2008 for SimTKcore by  doxygen 1.5.6