"""Grounded linear viscous damper, independent SciPy time-domain reference. Apache-2.0. Uses the exported solid-component ROM, not a neural network. """ import numpy as np from scipy.linalg import expm from assembly import solve def free_decay(chain, rolls=None, supports=None, node=None, axis=2, c=10000., amplitude=.001, mode_count=12, frames=600, duration=None): """First-mode release; peak coordinate amplitude in metres, c in N s/m. Zero initial velocity, no background damping or imposed forcing. Motion is a linear perturbation about equilibrium; thermal prestress is not included. Returns exact-in-time samples for the selected truncated modal equations. """ node=len(chain) if node is None else node if axis not in (0,1,2) or not 0<=node<=len(chain) or c<0 or not np.isfinite(c): raise ValueError('Invalid grounded damper') if not 0