Simbody
3.4 (development)
|
A linear damper that acts along or around a mobility coordinate to apply a generalized force there. More...
#include <Force_MobilityLinearDamper.h>
Public Member Functions | |
MobilityLinearDamper (GeneralForceSubsystem &forces, const MobilizedBody &mobod, MobilizerUIndex whichU, Real defaultDamping) | |
Create a MobilityLinearDamper force element on a particular mobility (generalized speed). | |
MobilityLinearDamper () | |
Default constructor creates an empty handle that can be assigned to refer to any MobilityLinearDamper object. | |
MobilityLinearDamper & | setDefaultDamping (Real defaultDamping) |
Provide a new value for the default damping constant c of this damper. | |
Real | getDefaultDamping () const |
Return the default value for the damper's damping constant c. | |
const MobilityLinearDamper & | setDamping (State &state, Real damping) const |
Change the value of the damping constant c in the given state; this may differ from the default value supplied at construction. | |
Real | getDamping (const State &state) const |
Return the value for the damping constant c that is stored in the given state. | |
Deprecated | |
Methods here are for backwards compatibility but have been replaced with better ones that you should use. | |
MobilityLinearDamper (GeneralForceSubsystem &forces, const MobilizedBody &mobod, int whichU, Real defaultDamping) | |
Deprecated: Alternate signature for backwards compatibilty -- for safety you should prefer using the other constructor signature that takes a MobilizerUIndex rather than a plain int. |
A linear damper that acts along or around a mobility coordinate to apply a generalized force there.
The damping constant c is provided, with the generated force being -c*u where u is the mobility's generalized speed. This is meaningful on any mobility, since all our generalized speeds have physical meaning. This is not a potential force and hence does not contribute to potential energy.
SimTK::Force::MobilityLinearDamper::MobilityLinearDamper | ( | GeneralForceSubsystem & | forces, |
const MobilizedBody & | mobod, | ||
MobilizerUIndex | whichU, | ||
Real | defaultDamping | ||
) |
Create a MobilityLinearDamper force element on a particular mobility (generalized speed).
[in,out] | forces | The subsystem to which this force should be added. |
[in] | mobod | Mobilizer to which the force should be applied. |
[in] | whichU | To which of the mobilizer's mobilities (generalized speeds) u should this force be applied (first is 0)? |
[in] | defaultDamping | The default value for the damping constant c. |
Default constructor creates an empty handle that can be assigned to refer to any MobilityLinearDamper object.
SimTK::Force::MobilityLinearDamper::MobilityLinearDamper | ( | GeneralForceSubsystem & | forces, |
const MobilizedBody & | mobod, | ||
int | whichU, | ||
Real | defaultDamping | ||
) | [inline] |
Deprecated: Alternate signature for backwards compatibilty -- for safety you should prefer using the other constructor signature that takes a MobilizerUIndex rather than a plain int.
MobilityLinearDamper& SimTK::Force::MobilityLinearDamper::setDefaultDamping | ( | Real | defaultDamping | ) |
Provide a new value for the default damping constant c of this damper.
This is a topological change because it affects the value that the containing System's default state will have when realizeTopology() is called. This is for use during construction, not for during a simulation where you should be using setDamping() to set the damping constant in a State rather than in the System.
[in] | defaultDamping | The default value for the damping constant c. |
Real SimTK::Force::MobilityLinearDamper::getDefaultDamping | ( | ) | const |
Return the default value for the damper's damping constant c.
This is normally set at construction but can be modified with setDefaultDamping().
const MobilityLinearDamper& SimTK::Force::MobilityLinearDamper::setDamping | ( | State & | state, |
Real | damping | ||
) | const |
Change the value of the damping constant c in the given state; this may differ from the default value supplied at construction.
[in,out] | state | The State in which the damping constant is to be changed. |
[in] | damping | The new damping constant c (>= 0) that overrides the default. |
Changing the damping constant invalidates Stage::Dynamics and above in the state since it can affect force generation.
Real SimTK::Force::MobilityLinearDamper::getDamping | ( | const State & | state | ) | const |
Return the value for the damping constant c that is stored in the given state.
Note that this is not the same thing as the default damping constant that was supplied on construction or in setDefaultDamping().