pydrake.multibody.benchmarks

class pydrake.multibody.benchmarks.MassDamperSpringAnalyticalSolution

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.

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.

__init__(self: pydrake.multibody.benchmarks.MassDamperSpringAnalyticalSolution, mass: float, b: float, k: float) None

This constructs the aforementioned mass-damper-spring system.

Parameter mass:

Mass of system (particle Q).

Parameter b:

Linear damping constant.

Parameter k:

Linear spring constant.

get_x(self: pydrake.multibody.benchmarks.MassDamperSpringAnalyticalSolution, t: float) float

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

get_xDt(self: pydrake.multibody.benchmarks.MassDamperSpringAnalyticalSolution, t: float) float

Returns ẋ (Nx measure of Q’s velocity in N) at time t.

get_xDtDt(self: pydrake.multibody.benchmarks.MassDamperSpringAnalyticalSolution, t: float) float

Returns ẍ (Nx measure of Q’s acceleration in N) at time t.

SetInitialValue(self: pydrake.multibody.benchmarks.MassDamperSpringAnalyticalSolution, x0: float, xDt0: float) None

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

Parameter x0:

Initial value of x (value of x at time t = 0).

Parameter xDt0:

Initial value of ẋ (value of ẋ at time t = 0).