Adjust mass and stiffness parameters of a 2-DOF spring-mass chain to compute natural frequencies, mode shapes, and FRF in real time with animated visualization.
System Parameters
m₁ =
kg
m₂ =
kg
k₁ =
N/m
k₂ =
N/m
k₃ =
N/m
—
f₁ (Hz)
—
f₂ (Hz)
—
Mode 1 ratio
—
Mode 2 ratio
Visualization
What is Modal Analysis?
🙋
What exactly is a "natural frequency"? And why does it matter for something like a car or a bridge?
🎓
Basically, every object has specific frequencies at which it naturally likes to vibrate if you tap it. Think of a tuning fork—it rings at one pure note. That's its natural frequency. For a car, if the engine vibrates at the same frequency as the chassis, you get a loud, shaky resonance. In the simulator above, the two masses represent parts of a structure. Try moving the `Mass m₁` slider—you'll see the animation speed and the calculated frequencies change instantly.
🙋
Wait, really? So the two masses vibrate differently? What's a "mode shape" then?
🎓
Exactly! A structure doesn't just have one frequency; it has a set of them. Each frequency has a corresponding "mode shape"—the specific pattern of motion. For our 2-mass system, the first mode might have both masses moving together. The second mode has them moving opposite each other. Click the "Mode 1" and "Mode 2" buttons in the simulator to see the animation switch between these distinct patterns. The stiffness of the springs (`k₁`, `k₂`, `k₃`) controls how tightly coupled these motions are.
🙋
Okay, that makes sense for the animation. But what's the FRF graph showing? It looks complicated.
🎓
The FRF, or Frequency Response Function, is the practical tool. It tells you how violently the system will shake when you force it at any frequency. The huge peaks you see? Those are at the natural frequencies—the system resonates. Try this: set `Spring k₂` to a very low value, like 100 N/m. See how the two peaks in the FRF move closer together? You've just decoupled the system, changing its dynamic behavior. This graph is exactly what CAE engineers use to predict vibration problems.
Physical Model & Key Equations
The core of modal analysis is solving an eigenvalue problem. We want to find the frequencies (ω) and shapes (φ) for which the structure can vibrate freely, balancing inertia forces (mass × acceleration) with elastic restoring forces (stiffness × displacement).
Here, K is the stiffness matrix (built from k₁, k₂, k₃), M is the mass matrix (from m₁, m₂), ω is the natural frequency (rad/s), and φ is the mode shape vector. For a non-trivial solution, the determinant must be zero.
This leads to the characteristic equation, a quadratic in ω² for our 2-DOF system. Solving it gives the two natural frequencies ω₁ and ω₂.
$$
\det(\mathbf{K}- \omega^2 \mathbf{M}) = 0
$$
The roots ω₁² and ω₂² are the eigenvalues. Plugging each back into the first equation gives the corresponding eigenvector, or mode shape, φ₁ and φ₂. These shapes are unique only in their relative motion—in the simulator, they are normalized so the largest displacement is 1.
Frequently Asked Questions
Increasing the mass decreases the natural frequency, while increasing the spring constant increases it. In particular, the first mode is sensitive to the overall stiffness and mass, while the second mode is sensitive to the mass ratio and spring arrangement. You can intuitively understand this by moving the slider and observing the mode animation.
The horizontal axis represents the excitation frequency, and the vertical axis represents the response magnitude (amplitude). The frequencies at which peaks occur correspond to the natural frequencies. In a two-degree-of-freedom system, two peaks appear, and if there is no damping, the response diverges to infinity. Changing the mass ratio or spring ratio alters the peak positions and heights.
Moving in the same direction is the first mode (in-phase), and moving in opposite directions is the second mode (out-of-phase). In the first mode, the entire system vibrates as a single unit, while in the second mode, the relative displacement between the masses becomes large. You can also confirm the presence or absence of nodes (points that do not move) in the animation.
A two-degree-of-freedom system can be used as a basic model for many real phenomena. For example, it can represent vibration isolation devices with two masses or a two-layer model of a building. However, since actual structures include continua and nonlinear elements, it is recommended to use this tool for qualitative understanding and trend analysis.
Real-World Applications
Automotive NVH (Noise, Vibration, Harshness): Engineers use modal analysis to ensure the natural frequencies of the car body, engine mounts, and exhaust system don't align with engine firing frequencies (e.g., 30-200 Hz). This prevents steering wheel shake or booming cabin noise at highway speeds.
Seismic Design of Buildings: A building's fundamental sway modes must be identified. If the period of ground motion from an earthquake matches the building's natural period, resonance can cause catastrophic amplification of vibrations. Analysis guides the design of dampers and bracing.
Aerospace Flutter Prevention: Aircraft wings and control surfaces are susceptible to flutter—a dangerous, self-excited vibration where aerodynamic forces couple with structural modes. Modal analysis predicts these critical flight envelopes to keep the wing's natural frequencies away from excitation sources.
Consumer Electronics Durability: Your smartphone undergoes "bump" testing. Modal analysis identifies how the circuit board vibrates when dropped. Engineers then design mounts and casings to shift these frequencies higher (making it stiffer) or add damping to prevent solder joint fatigue from repeated vibration.
Common Misconceptions and Points to Note
When you start using this simulator, there are a few common pitfalls. First, "setting mass to zero will break the calculation." For example, try setting m2 to 0? The natural frequency will diverge to infinity, or you'll get a calculation error. Mass cannot be zero in reality, and numerically, the inverse of the mass matrix is required, so zero or extremely small values are prohibited. Next, it's easy to think "if all spring constants are the same, the mode shapes will also be symmetric," but that's only true if the masses are also identical. With m1=1, m2=3 and k1=k2=k3=1, in the first mode, the heavier m2 will have a smaller amplitude. I want you to experience how mode shapes are determined by the *ratio* of mass and stiffness. Finally, don't overtrust the peak height (peak value) on the FRF graph. This simulator does not include damping, so theoretically the peak is infinitely sharp. Real structures always have damping, so peaks have finite height and width. Keep this in mind when using the tool to discuss "resonance risks."