OpenSim::Springs Class Reference

A class which implements a set of static functions which model the stress-strain properties of a number of different types of springs. More...

#include <Springs.h>

List of all members.

Public Member Functions

 Springs ()
 Default constructor.
virtual ~Springs ()
 Destructor.

Static Public Member Functions

static double Damp (double kv, double v)
 Compute a linear damping force based on a damping constant, kv, and a velocity, v.
static double Linear (double kx, double dx)
 Compute a linear spring force based on a spring constant, k, and a deviation from the rest length, dx.
static double Linear (double kx, double x0, double x)
 Compute a linear spring force based on a spring constant, k, a spring zero, x0, and a spring length, x.
static double DampedLinear (double kv, double v, double kx, double x0, double x)
 Compute a linear damped spring force based on a damping constant, kv, a velocity, v, a spring stiffness, kx, a spring zero, xo, and a spring length, x.
static double ZeroForDampedLinear (double kv, double v, double kx, double x, double f)
 Compute a spring zero to achieve a given force, f, given a damping constant, kv, a velocity, v, a spring stiffness, kx, and a spring position, x.
static double DisplacementOfDampedLinear (double kv, double v, double kx, double f)
 Compute the spring length that will achieve a desired stiffness.
static double Quadratic (double kx, double dx)
 Compute a quadratic spring force based on a spring constant, kx, and a deviation from the rest length, dx.
static double Quadratic (double kx, double x0, double x)
 Compute a quadratic spring force based on a spring constant, kx, a spring zero, x0, and a spring length, x.
static double DampedQuadratic (double kv, double v, double kx, double dx)
 Compute a quadratic damped spring force based on a damping constant, kv, a velocity, v, a spring stiffness, kx, and a deviation from rest length, dx.
static double DampedQuadratic (double kv, double v, double kx, double x0, double x)
 Compute a quadratic damped spring force based on a damping constant, kv, a velocity, v, a spring stiffness, kx, a spring zero, x0, and a spring length, x.
static double ExponentialBarrier (double v, double dx)
 Compute an exponential spring force based on the distance, dx, of a point from a plane and the velocity of the point v.
static double ExponentialBarrier (double aG0, double aG1, double aG2, double aE0, double aE1, double aE2, double aKV, double aV, double aDX)
 Compute an exponential spring force based on the distance, dx, of a point from a plane and the velocity of the point v.
static double ExponentialBarrierDX (double v, double dx)
 Compute the stiffness of the exponential barrier with respect to changes in x.
static double ExponentialBarrierDX (double aG0, double aG1, double aG2, double aE0, double aE1, double aE2, double aKV, double aV, double aDX)
 Compute the stiffness of the exponential barrier with respect to changes in x.
static double ExponentialBarrierDV (double v, double dx)
 Compute the stiffness of the exponential barrier with respect to changes in v.
static double ExponentialBarrierDV (double aG0, double aG1, double aG2, double aE0, double aE1, double aE2, double aKV, double aV, double aDX)
 Compute the stiffness of the exponential barrier with respect to changes in v.
static double oscillation (double delay, double t, double f)
 Return an oscilation amplitude as a function of time.

Detailed Description

A class which implements a set of static functions which model the stress-strain properties of a number of different types of springs.

Author:
Frank C. Anderson

Constructor & Destructor Documentation

Springs::Springs (  ) 

Default constructor.

Springs::~Springs (  )  [virtual]

Destructor.


Member Function Documentation

double Springs::Damp ( double  kv,
double  v 
) [static]

Compute a linear damping force based on a damping constant, kv, and a velocity, v.

The argument kv is assumed to be a non-negative constant.

double Springs::DampedLinear ( double  kv,
double  v,
double  kx,
double  xo,
double  x 
) [static]

Compute a linear damped spring force based on a damping constant, kv, a velocity, v, a spring stiffness, kx, a spring zero, xo, and a spring length, x.

The kv and kx are assumed to be non-negative constants.

double Springs::DampedQuadratic ( double  kv,
double  v,
double  kx,
double  x0,
double  x 
) [static]

Compute a quadratic damped spring force based on a damping constant, kv, a velocity, v, a spring stiffness, kx, a spring zero, x0, and a spring length, x.

The kv and kx are assumed to be non-negative constants.

double Springs::DampedQuadratic ( double  kv,
double  v,
double  kx,
double  dx 
) [static]

Compute a quadratic damped spring force based on a damping constant, kv, a velocity, v, a spring stiffness, kx, and a deviation from rest length, dx.

The kv and kx are assumed to be non-negative constants.

double Springs::DisplacementOfDampedLinear ( double  kv,
double  v,
double  kx,
double  f 
) [static]

Compute the spring length that will achieve a desired stiffness.

Parameters:
kv Damping constant (assumed non-negative).
v Velocity of the spring.
kx Stiffness (assumed non-negative).
f Desired force in the spring.
double Springs::ExponentialBarrier ( double  aG0,
double  aG1,
double  aG2,
double  aE0,
double  aE1,
double  aE2,
double  aKV,
double  aV,
double  aDX 
) [static]

Compute an exponential spring force based on the distance, dx, of a point from a plane and the velocity of the point v.

This spring type is often used to represent a firm floor or a wall.

dx is assumed to be a positive quantity. At large dx, the force is negligible. As dx approaches 0.0, the force increases exponentially. v is included so that a damping force can also be computed. The damping force allows numerical integrations to execute more efficiently. The sign of v should be positive if the point is moving away from the barrier (dx increasing), and negative if moving toward the barrier (dx decreasing).

double Springs::ExponentialBarrier ( double  v,
double  dx 
) [static]

Compute an exponential spring force based on the distance, dx, of a point from a plane and the velocity of the point v.

This spring type is often used to represent a firm floor or a wall.

dx is assumed to be a positive quantity. At large dx, the force is negligible. As dx approaches 0.0, the force increases exponentially. v is included so that a damping force can also be computed. The damping force allows numerical integrations to execute more efficiently. The sign of v should be positive if the point is moving away from the barrier (dx increasing), and negative if moving toward the barrier (dx decreasing).

double Springs::ExponentialBarrierDV ( double  aG0,
double  aG1,
double  aG2,
double  aE0,
double  aE1,
double  aE2,
double  aKV,
double  aV,
double  aDX 
) [static]

Compute the stiffness of the exponential barrier with respect to changes in v.

double Springs::ExponentialBarrierDV ( double  v,
double  dx 
) [static]

Compute the stiffness of the exponential barrier with respect to changes in v.

double Springs::ExponentialBarrierDX ( double  aG0,
double  aG1,
double  aG2,
double  aE0,
double  aE1,
double  aE2,
double  aKV,
double  aV,
double  aDX 
) [static]

Compute the stiffness of the exponential barrier with respect to changes in x.

double Springs::ExponentialBarrierDX ( double  v,
double  dx 
) [static]

Compute the stiffness of the exponential barrier with respect to changes in x.

double Springs::Linear ( double  k,
double  x0,
double  x 
) [static]

Compute a linear spring force based on a spring constant, k, a spring zero, x0, and a spring length, x.

The argument k is assumed to be a non-negative constant.

double Springs::Linear ( double  k,
double  dx 
) [static]

Compute a linear spring force based on a spring constant, k, and a deviation from the rest length, dx.

dx = x - x0, where x is the length of the spring and x0 is the rest length of the spring.

The argument k is assumed to be a non-negative constant.

double Springs::oscillation ( double  delay,
double  t,
double  f 
) [static]

Return an oscilation amplitude as a function of time.

The returned amplitued oscillates about 0.0 with an amplitude of 1.0 (i.e., between 0.5 and 1.5) with a frequency of f. If t is less than or equal to delay, 0.0 is returned.

double Springs::Quadratic ( double  kx,
double  x0,
double  x 
) [static]

Compute a quadratic spring force based on a spring constant, kx, a spring zero, x0, and a spring length, x.

The argument kx is assumed to be a non-negative constant.

double Springs::Quadratic ( double  kx,
double  dx 
) [static]

Compute a quadratic spring force based on a spring constant, kx, and a deviation from the rest length, dx.

dx = x - x0, where x is the length of the spring and x0 is the rest length of the spring.

The argument kx is assumed to be a non-negative constant.

double Springs::ZeroForDampedLinear ( double  kv,
double  v,
double  kx,
double  x,
double  f 
) [static]

Compute a spring zero to achieve a given force, f, given a damping constant, kv, a velocity, v, a spring stiffness, kx, and a spring position, x.

Parameters:
kv Damping constant (assumed non-negative).
v Velocity of the spring.
kx Stiffness (assumed non-negative).
x Position of the spring.
f Desired force in the spring.

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

Generated on Wed Dec 16 15:03:38 2009 for OpenSim by  doxygen 1.6.1