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*ẋ*Nx where b is a damper constant and ẋ is the time-derivative of x.
T | The scalar type, which must be one of the default nonsymbolic scalars. |
#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 ẋ for this system. More... | |
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, ẋ, ẍ 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 ẋ (Nx measure of Q's velocity in N) at time t. More... | |
T | get_xDtDt (const T &t) const |
Returns ẍ (Nx measure of Q's acceleration in N) at time t. More... | |
Does not allow copy, move, or assignment | |
MassDamperSpringAnalyticalSolution (const MassDamperSpringAnalyticalSolution &)=delete | |
MassDamperSpringAnalyticalSolution & | operator= (const MassDamperSpringAnalyticalSolution &)=delete |
MassDamperSpringAnalyticalSolution (MassDamperSpringAnalyticalSolution &&)=delete | |
MassDamperSpringAnalyticalSolution & | operator= (MassDamperSpringAnalyticalSolution &&)=delete |
|
delete |
|
delete |
MassDamperSpringAnalyticalSolution | ( | const T & | mass, |
const T & | b, | ||
const T & | k | ||
) |
This constructs the aforementioned mass-damper-spring system.
[in] | mass | Mass of system (particle Q). |
[in] | b | Linear damping constant. |
[in] | k | Linear spring constant. |
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, ẋ, ẍ at time t.
[in] | t | The value of time at which output is requested. |
T get_x | ( | const T & | t | ) | const |
Returns x (Nx measure of Q's position from No) at time t.
T get_xDt | ( | const T & | t | ) | const |
Returns ẋ (Nx measure of Q's velocity in N) at time t.
T get_xDtDt | ( | const T & | t | ) | const |
Returns ẍ (Nx measure of Q's acceleration in N) at time t.
|
delete |
|
delete |
void SetInitialValue | ( | const T & | x0, |
const T & | xDt0 | ||
) |
Sets the initial values of x and ẋ for this
system.
[in] | x0 | Initial value of x (value of x at time t = 0). |
[in] | xDt0 | Initial value of ẋ (value of ẋ at time t = 0). |