|
Simbody
3.4 (development)
|
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: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. | |
| TwoPointLinearSpring () | |
| Default constructor creates an empty handle. | |
| SimTK_INSERT_DERIVED_HANDLE_DECLARATIONS (TwoPointLinearSpring, TwoPointLinearSpringImpl, Force) | |
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.
| 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.
| forces | the subsystem to which this force should be added |
| body1 | the first body to which the force should be applied |
| station1 | the location on the first body at which the force should be applied |
| body2 | the second body to which the force should be applied |
| station2 | the location on the second body at which the force should be applied |
| k | the spring constant |
| x0 | the distance at which the force is 0 |
Default constructor creates an empty handle.
| SimTK::Force::TwoPointLinearSpring::SimTK_INSERT_DERIVED_HANDLE_DECLARATIONS | ( | TwoPointLinearSpring | , |
| TwoPointLinearSpringImpl | , | ||
| Force | |||
| ) |