Simbody
Public Member Functions

SimTK::Force::TwoPointLinearSpring Class Reference

A linear spring between two points, specified as a station on each of two bodies. More...

#include <Force.h>

Inheritance diagram for SimTK::Force::TwoPointLinearSpring:

List of all members.

Public Member Functions

 TwoPointLinearSpring (GeneralForceSubsystem &forces, const MobilizedBody &body1, const Vec3 &station1, const MobilizedBody &body2, const Vec3 &station2, Real k, Real x0)
 Create a TwoPointLinearSpring.
 SimTK_INSERT_DERIVED_HANDLE_DECLARATIONS (TwoPointLinearSpring, TwoPointLinearSpringImpl, Force)

Detailed Description

A linear spring between two points, specified as a station on each of two bodies.

The stiffness k and unstretched length x0 are provided. Then if d is the unit vector from point1 to point2, and x the current separation, we have f = k(x-x0) and we apply a force f*d to point1 and -f*d to point2. This contributes to potential energy: pe = 1/2 k (x-x0)^2. It is an error if the two points become coincident, since we are unable to determine a direction for the force in that case.


Constructor & Destructor Documentation

SimTK::Force::TwoPointLinearSpring::TwoPointLinearSpring ( GeneralForceSubsystem forces,
const MobilizedBody body1,
const Vec3 station1,
const MobilizedBody body2,
const Vec3 station2,
Real  k,
Real  x0 
)

Create a TwoPointLinearSpring.

Parameters:
forcesthe subsystem to which this force should be added
body1the first body to which the force should be applied
station1the location on the first body at which the force should be applied
body2the second body to which the force should be applied
station2the location on the second body at which the force should be applied
kthe spring constant
x0the distance at which the force is 0

Member Function Documentation

SimTK::Force::TwoPointLinearSpring::SimTK_INSERT_DERIVED_HANDLE_DECLARATIONS ( TwoPointLinearSpring  ,
TwoPointLinearSpringImpl  ,
Force   
)

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