Horizontal Coupled Mass-Spring System
Simulate 1–4 coupled masses with springs, damping, and arbitrary forcing \(M\ddot{\mathbf{x}}+C\dot{\mathbf{x}}+K\mathbf{x}=\mathbf{F}(t)\) — observe normal modes, resonance, and beats in real time.
Identical masses are connected by identical springs to each other and to fixed walls on either side. The governing system is \(M\ddot{\mathbf{x}}+C\dot{\mathbf{x}}+K\mathbf{x}=\mathbf{F}(t)\), where \(K\) is the tridiagonal stiffness matrix.
Special Forcing Functions
5*delta(t-10).u(t-5)*sin(3*t).Resonance
Resonance occurs when the forcing frequency matches a natural frequency. The default 2-mass example shows in-phase resonance at \(\omega_1=\sqrt{k/m}=2\) rad/s. With zero damping, amplitude grows without bound.
Normal Modes (2 Masses)
- In-phase mode (\(\omega_1=\sqrt{k/m}\)): both masses move together.
- Out-of-phase mode (\(\omega_2=\sqrt{3k/m}\)): masses move in opposite directions.
Equal initial displacements excite the in-phase mode; opposite displacements excite the out-of-phase mode. Unequal initial conditions produce beats — a periodic exchange of energy between the masses.
Numerical Method
The simulation uses the velocity Verlet (Störmer) integrator — a symplectic method that conserves energy well in undamped cases. Fixed step \(\Delta t=0.01\,\text{s}\).