---
title: Spring-Mass Trajectory Libraries
url: https://www.emergentmind.com/topics/spring-mass-trajectory-libraries
type: topic
---

# Spring-Mass Trajectory Libraries

Spring-mass trajectory libraries are comprehensive, precomputed sets of solutions to the equations of motion governing spring-mass systems, structured for efficient retrieval and application in both classical vibrational analysis and biomimetic locomotion control. These libraries encode parameterized families of periodic or transient state trajectories—typically center-of-mass or mass node positions—supporting analyses and control approaches across disciplines including physics, applied mathematics, and robotics [1904.02542][2512.13304].

## 1. Foundations: Dynamical Systems and Model Classes

Spring-mass models fall into two main categories: multi-degree-of-freedom lattices (chains or networks of masses and springs), and reduced-order hybrid models for legged locomotion (e.g., the spring-loaded inverted pendulum, or SLIP, template). The canonical Hamiltonian for a chain of $N$ masses with nearest-neighbor springs is
\[
H = \frac{1}{2}\sum_{i=1}^N \frac{p_i^2}{m_i} + \frac{1}{2}\sum_{i=1}^{N} k_i\bigl(x_{i+1}-x_i\bigr)^2,
\]
with appropriate boundary conditions ($x_{N+1} \equiv x_1$ for circular; fixed or free for linear chains). The resulting equations of motion underlie all linear vibrational analyses and form the basis for constructing trajectory libraries for arbitrary mass and stiffness profiles [1904.02542].

For biomimetic locomotion, the 3D SLIP template is defined by the center-of-mass (CoM) position $\mathbf{p}_c$, fixed foot point $\mathbf{p}_f$, leg vector $\mathbf{r}=\mathbf{p}_c-\mathbf{p}_f$, mass $m$, stiffness $k$, rest length $r_0$, and touchdown angles $(\theta_1,\theta_2)$, with hybrid stance and flight phases dictated by norm thresholds $\|\mathbf{r}\| < r_0$ and apex-to-apex periodic search [2512.13304].

## 2. Lie-Algebraic Methods and Normal Mode Decomposition

For finite-dimensional spring-mass networks, Lie-algebraic structure facilitates diagonalization of the dynamical matrix $\mathbf{M}$. 

- **Circular chains** leverage shift operators $V$, $V^\dagger$ generating a discrete $U(1)$ algebra, diagonalized via the discrete Fourier transform $F$; normal frequencies are $\omega_j = 2\sqrt{\tfrac{k}{m}|\sin(\pi j/N)|}$ and mode shapes are $N$-periodic complex exponentials:
  \[
  \phi_j(i) = \frac{1}{\sqrt{N}}e^{2\pi i j i / N}.
  \]

- **Linear chains** with special (binomial) mass/spring profiles employ $su(2)$ generators $K_0$, $K_+$, $K_-$, with orthonormal Chebyshev or Kravchuk polynomial-based transforms yielding explicit mode spectra and analytical diagonalizations for all $N$ [1904.02542].

In both cases, the exact time-evolution of each $x_i(t)$ is reconstructed as a superposition of mode shapes scaled by initial conditions and oscillatory terms $\cos(\omega_j t)$, $\sin(\omega_j t)$.

## 3. Library Generation and Trajectory Parameterization

### Linear Systems (Chains and Lattices)

Library generation consists in tabulating, for a specified class (linear/circular, fixed/periodic boundaries, uniform/graded mass and stiffness):

1. Dynamical matrix $\mathbf{M}$ and associated parameters ($\{m_i\}$, $\{k_i\}$).
2. Diagonalizing transform $S$ (e.g., DFT, Chebyshev, $su(2)$ rotations).
3. Eigenfrequencies $\omega_j$ and mode shapes $\phi_j(i)$.
4. Explicit trajectory function:
   \[
   x_i(t) = \sum_{j=1}^N \left[ \phi_j(i)x_j(0) \cos(\omega_j t) + \frac{\phi_j(i)\dot{x}_j(0)}{\omega_j} \sin(\omega_j t) \right].
   \]

Each entry combines the dynamical specification, initial conditions, and closed-form evolution, enabling efficient lookup and reuse for system simulation, control, or vibration analysis [1904.02542].

### SLIP-based Apex-to-Apex Trajectories

For spring-mass template models relevant to locomotion:

1. Discretized grids over apex height $h$, forward speed $v_x$, stiffness $k$, and lateral touchdown angle $\theta_2$.
2. Nonlinear least-squares solved (e.g., via Ceres) for periodic solutions in variables $\zeta=[\theta_1,v_y]$ given apex state $x^*$, control input $u$, and parameterization $\left(h,k,v_x,\theta_2\right)$.
3. Numerical integration (Runge-Kutta) progresses flight and stance phases, checking periodicity and feasibility.
4. Resultant library entries store $h$, $k$, $v_x$, $\theta_2$, $\theta_1^*$, $v_y^*$ plus derived foot placements $(\delta_{i,x},\delta_{i,y})$ [2512.13304].

Total generation time for 315 such periodic apex-to-apex trajectories is approximately $4.5\text{ s}$ offline.

## 4. Controller Synthesis and Real-Time Trajectory Selection

For real-time adaptive locomotion using spring-mass trajectory libraries, control is realized through:

- **Deadbeat control gain libraries**: At each periodic trajectory, local linearization yields Jacobians $J_x$, $J_u$ of the return map. The deadbeat gain matrix $K = -J_u^{-1}J_x$ enables feedback correction:
  \[
  \Delta u = -J_u^{-1}J_x\,\Delta x,
  \]
  guaranteeing aperiodic state error elimination after one step in the linearized regime.

- **Selection policy**: At runtime, given the sensed touchdown state $x_\text{TD}$ and leg state $u_\text{TD}$, all library entries are scored via the cost
  \[
  \|u_\text{TD} - (u^*_i + K_i(x_\text{TD} - x^*_i))\|_2,
  \]
  promoting high-probability convergence [2512.13304]. Obstacle and stepping-stone constraints are implemented by filtering entries according to apex clearance and target region reachability.

The entire selection process, including local filtering and evaluation, is $O(n)$ with measured $20\;\mu$s per step for $n=315$ library entries.

## 5. Whole-body Mapping, Adaptive Behaviors, and Practical Implementation

Mapping spring-mass trajectories to high-dimensional humanoid models is conducted via whole-body control (WBC) frameworks:

- **Inverse dynamics constraints**: Floating-base equations $M(q)\,\dot{y} + C(q,y)\,y + \tau_g$ are solved in a quadratic program, enforcing foot constraints, friction cones, actuator limits, and closed-kinematic-chain requirements.
- **Collision avoidance**: Task velocities are projected onto admissible tangent spaces if imminent collision is detected.
- **Reactive limb swing**: Nullspace projection of posture tasks and momentum regulation dampens disturbances.

C++-style data structures encapsulate each trajectory and associated deadbeat gain:
```cpp
struct Trajectory {
  double θ2, h, k, vx, θ1, vy, δx, δy;
  Matrix3d K;
};
std::vector<Trajectory> library;
```
Real-time retrieval filters the library by task-specific constraints before minimizing the cost. All agility behaviors—random stepping, slalom, direction changes, disturbance rejection—share a single trajectory/gain library and WBC parameterization with no per-trajectory tuning [2512.13304].

## 6. Robustness and Performance under Uncertainty

Injected signal noise (velocity $\sigma_v\approx0.02$ m/s, angular $\sigma_\omega\approx0.1$ rad/s), actuator delays (1–2 ms), and $5\%$ mass/inertia disturbances are handled robustly. The combination of deadbeat-leg re-planning and two-step look-ahead mitigates the effect of errors, achieving steady-running root mean square errors of
\[
v_x\text{ RMSE} \approx 0.085\text{ m/s},\quad v_y\text{ RMSE} \approx 0.021\text{ m/s}
\]
during unstructured locomotion in simulation [2512.13304].

## 7. Comparison of Spring-Mass Trajectory Libraries

| Application Domain                | Core Model                | Library Components                   |
|-----------------------------------|---------------------------|--------------------------------------|
| Vibrational analysis (chains)     | Hamiltonian chain         | $(\mathbf{M}, S, \omega, \phi, x_i(t))$   |
| Biomimetic locomotion (SLIP)      | 3D SLIP template          | $(h, k, v_x, \theta_2, \theta_1, v_y, \delta_x, \delta_y, K)$ |
| Whole-body robot control          | SLIP + WBC mapping        | Trajectory structs, deadbeat gains   |

Both approaches leverage the precomputation of parameter-rich trajectory sets to enable fast retrieval, analytical insight into system dynamics, and robust real-time performance in simulation and robotics.

---

References:  
[1904.02542]: Dynamical analysis of mass-spring models using Lie algebraic methods  
[2512.13304]: Humanoid Robot Running Through Random Stepping Stones and Jumping Over Obstacles: Step Adaptation Using Spring-Mass Trajectories

Source: https://www.emergentmind.com/topics/spring-mass-trajectory-libraries