Simbody  3.4 (development)
SimTK::Constraint::ConstantSpeed Class Reference

Constrain a single mobility to have a particular speed. More...

#include <Constraint.h>

+ Inheritance diagram for SimTK::Constraint::ConstantSpeed:

List of all members.

Public Member Functions

 ConstantSpeed (MobilizedBody &mobilizer, MobilizerUIndex whichU, Real defaultSpeed)
 Construct a constant speed constraint on a particular mobility of the given mobilizer.
 ConstantSpeed (MobilizedBody &mobilizer, Real defaultSpeed)
 Construct a constant speed constraint on the mobility of the given mobilizer, assuming there is only one mobility.
 ConstantSpeed ()
 Default constructor creates an empty handle.
MobilizedBodyIndex getMobilizedBodyIndex () const
 Return the index of the mobilized body to which this constant speed constraint is being applied (to one of its mobilities).
MobilizerUIndex getWhichU () const
 Return the particular mobility whose generalized speed is controlled by this ConstantSpeed constraint.
Real getDefaultSpeed () const
 Return the default value for the speed to be enforced.
ConstantSpeedsetDefaultSpeed (Real speed)
 Change the default value for the speed to be enforced by this constraint.
void setSpeed (State &state, Real speed) const
 Override the default speed with this one whose value is stored in the given State.
Real getSpeed (const State &state) const
 Get the current value of the speed set point from the indicated State.
Real getVelocityError (const State &state) const
 Return the amount by which the given State fails to satisfy this ConstantSpeed constraint.
Real getAccelerationError (const State &state) const
 Return the amount by which the accelerations in the given State fail to satify the time derivative of this constraint (which must be zero).
Real getMultiplier (const State &) const
 Get the value of the Lagrange multipler generated to satisfy this constraint.

Detailed Description

Constrain a single mobility to have a particular speed.

One non-holonomic constraint equation. Some mobility u is required to be at a particular value s.

The assembly condition is the same as the run-time constraint: u must be set to s.


Constructor & Destructor Documentation

SimTK::Constraint::ConstantSpeed::ConstantSpeed ( MobilizedBody mobilizer,
MobilizerUIndex  whichU,
Real  defaultSpeed 
)

Construct a constant speed constraint on a particular mobility of the given mobilizer.

SimTK::Constraint::ConstantSpeed::ConstantSpeed ( MobilizedBody mobilizer,
Real  defaultSpeed 
)

Construct a constant speed constraint on the mobility of the given mobilizer, assuming there is only one mobility.

Default constructor creates an empty handle.


Member Function Documentation

Return the index of the mobilized body to which this constant speed constraint is being applied (to one of its mobilities).

This is set on construction of the ConstantSpeed constraint.

Return the particular mobility whose generalized speed is controlled by this ConstantSpeed constraint.

This is set on construction.

Return the default value for the speed to be enforced.

This is set on construction or via setDefaultSpeed(). This is used to initialize the speed when a default State is created, but it can be overriden by changing the value in the State using setSpeed().

Change the default value for the speed to be enforced by this constraint.

This is a topological change, meaning you'll have to call realizeTopology() on the containing System and obtain a new State before you can use it. If you just want to make a runtime change in the State, see setSpeed().

void SimTK::Constraint::ConstantSpeed::setSpeed ( State state,
Real  speed 
) const

Override the default speed with this one whose value is stored in the given State.

This invalidates the Velocity stage in the state. Don't confuse this with setDefaultSpeed() -- the value set here overrides that one.

Real SimTK::Constraint::ConstantSpeed::getSpeed ( const State state) const

Get the current value of the speed set point from the indicated State.

This is the value currently in effect, either from the default or from a previous call to setSpeed().

Return the amount by which the given State fails to satisfy this ConstantSpeed constraint.

The state must already be realized through Stage::Velocity.

Return the amount by which the accelerations in the given State fail to satify the time derivative of this constraint (which must be zero).

The state must already be realized through Stage::Acceleration.

Get the value of the Lagrange multipler generated to satisfy this constraint.

For a ConstantSpeed constraint, that is the same as the generalized force although by convention constraint multipliers have the opposite sign from applied forces. The state must already be realized through Stage::Acceleration.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines