Drake
MassDamperSpringAnalyticalSolution< T > Class Template Reference

This class provides an analytical solution to a mass-damper-spring system. More...

#include <drake/multibody/benchmarks/mass_damper_spring/mass_damper_spring_analytical_solution.h>

## Public Member Functions

MassDamperSpringAnalyticalSolution (const T &mass, const T &b, const T &k)
This constructs the aforementioned mass-damper-spring system. More...

void SetInitialValue (const T &x0, const T &xDt0)
Sets the initial values of x and ẋ for this system. More...

Vector3< TCalculateOutput (const T &t) const
For this mass-damper-spring system, and with the given initial values, this method calculates the values of x, ẋ, ẍ at time t. More...

T get_x (const T &t) const
Returns x (Nx measure of Q's position from No) at time t. More...

T get_xDt (const T &t) const
Returns ẋ (Nx measure of Q's velocity in N) at time t. More...

T get_xDtDt (const T &t) const
Returns ẍ (Nx measure of Q's acceleration in N) at time t. More...

Does not allow copy, move, or assignment
MassDamperSpringAnalyticalSolution (const MassDamperSpringAnalyticalSolution &)=delete

MassDamperSpringAnalyticalSolutionoperator= (const MassDamperSpringAnalyticalSolution &)=delete

MassDamperSpringAnalyticalSolution (MassDamperSpringAnalyticalSolution &&)=delete

MassDamperSpringAnalyticalSolutionoperator= (MassDamperSpringAnalyticalSolution &&)=delete

## Detailed Description

### template<typename T> class drake::multibody::benchmarks::MassDamperSpringAnalyticalSolution< T >

This class provides an analytical solution to a mass-damper-spring system.

The system consists of a particle Q of mass m that can only move left/right on flat Earth (frame N). Particle Q is connected by an ideal translational spring/damper. The other end of the spring/damper is welded to point No (the origin of frame N). Q's position from No is x*Nx where x(t) is a time- dependent variable (to-be-calculated) and Nx is a horizontal unit vector fixed in Earth (N). The spring force on Q is -k*x*Nx, where k is a spring constant. The damper force on Q is -b*ẋ*Nx where b is a damper constant and ẋ is the time-derivative of x.

Instantiated templates for the following kinds of T's are provided and available to link against in the containing library:

• double
• AutoDiffXd
Note
All units must be self-consistent (e.g., standard SI with MKS units). The solution provided herein is also applicable to a rotating system, e.g., having rigid-body inertia, rotational damper, rotational spring.

## Constructor & Destructor Documentation

 MassDamperSpringAnalyticalSolution ( const MassDamperSpringAnalyticalSolution< T > & )
delete
 MassDamperSpringAnalyticalSolution ( MassDamperSpringAnalyticalSolution< T > && )
delete
 MassDamperSpringAnalyticalSolution ( const T & mass, const T & b, const T & k )
inline

This constructs the aforementioned mass-damper-spring system.

Parameters
 [in] mass Mass of system (particle Q). [in] b Linear damping constant. [in] k Linear spring constant.

## Member Function Documentation

 Vector3< T > CalculateOutput ( const T & t ) const

For this mass-damper-spring system, and with the given initial values, this method calculates the values of x, ẋ, ẍ at time t.

Parameters
 [in] t The value of time at which output is requested.
Returns
Three-element matrix consisting of x, ẋ, ẍ, respectively.
 T get_x ( const T & t ) const
inline

Returns x (Nx measure of Q's position from No) at time t.

 T get_xDt ( const T & t ) const
inline

Returns ẋ (Nx measure of Q's velocity in N) at time t.

 T get_xDtDt ( const T & t ) const
inline

Returns ẍ (Nx measure of Q's acceleration in N) at time t.

 MassDamperSpringAnalyticalSolution& operator= ( MassDamperSpringAnalyticalSolution< T > && )
delete
 MassDamperSpringAnalyticalSolution& operator= ( const MassDamperSpringAnalyticalSolution< T > & )
delete
 void SetInitialValue ( const T & x0, const T & xDt0 )
inline

Sets the initial values of x and ẋ for this system.

Parameters
 [in] x0 Initial value of x (value of x at time t = 0). [in] xDt0 Initial value of ẋ (value of ẋ at time t = 0).

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