Spring Pendulum Simulator Back
NONLINEAR VIBRATION · CHAOS

Spring Pendulum (Elastic Pendulum) Simulator

Watch spring stretching and pendulum swinging become coupled through nonlinear dynamics. RK4 integration reveals parametric resonance, energy transfer, and chaos.

Presets
Spring & Mass Parameters
Natural Length L₀ (m)
m
Spring Constant k (N/m)
N/m
Mass m (kg)
kg
Initial Conditions
Initial Length r₀ (m)
m
Initial Angle θ₀ (°)
°
Initial dr/dt (m/s)
m/s
Initial dθ/dt (rad/s)
rad/s
Simulation Speed
Speed
Resonance Check:
ω_spring = rad/s
ω_pendulum = rad/s
Ratio = (≈2 for resonance)
Results
Spring Length r (m)
Angle θ (°)
Total Energy (J)
Spring Extension (m)
Spring

Colored trail: 600-point history. Brighter = faster.

Theory & Key Formulas
$$\ddot{r}= r\dot{\theta}^2 + g\cos\theta + \frac{k}{m}(L_0 - r)$$ $$\ddot{\theta}= \frac{-g\sin\theta - 2\dot{r}\dot{\theta}}{r}$$ RK4 integration, dt=0.001s

What is a Spring Pendulum?

🙋
What exactly is a "spring pendulum"? It sounds like you just combined a spring and a regular pendulum.
🎓
Basically, yes! But the combination creates a fascinating, nonlinear system. The mass is attached by a spring instead of a rigid rod. So it can both swing like a pendulum and bounce up and down on the spring. Try moving the "Initial Length r₀" slider in the simulator—you'll see the starting stretch of the spring change instantly.
🙋
Wait, really? So it's not just two motions added together? What's this "parametric resonance" mentioned in the description?
🎓
Great question! That's the key nonlinear effect. The swinging motion changes the effective length of the pendulum, which in turn drives the spring's bouncing motion, and vice-versa. When the spring's natural frequency is about twice the pendulum's swing frequency, a small initial bounce can get wildly amplified. In the simulator, set k/m so that $\sqrt{k/m}\approx 2\sqrt{g/L_0}$ and give it a tiny initial dr/dt to see it happen!
🙋
That colored trail showing the history is really cool but chaotic. How do engineers predict this kind of motion? Can't use simple formulas, right?
🎓
Exactly right—you need numerical simulation, which is what this tool does using a method called RK4. Engineers use the same principles in CAE software. The equations governing the motion are coupled, meaning the r and θ variables depend on each other. Play with the "Initial dθ/dt" parameter and watch how a fast initial spin completely changes the bouncing pattern, demonstrating this coupling.

Physical Model & Key Equations

The motion is described in polar coordinates (r, θ). The first equation governs the radial (bouncing) acceleration. It has three parts: centrifugal force from swinging, gravity's radial component, and the spring's restoring force.

$$\ddot{r}= r\dot{\theta}^2 + g\cos\theta + \frac{k}{m}(L_0 - r)$$

Here, $\ddot{r}$ is radial acceleration (m/s²), $r\dot{\theta}^2$ is the centrifugal term, $+g\cos\theta$ is gravity's pull along the spring, and $\frac{k}{m}(L_0 - r)$ is the spring acceleration towards its natural length $L_0$.

The second equation governs the angular (swinging) acceleration. It's similar to a pendulum but modified by the fact the "rod" length r is changing.

$$\ddot{\theta}= \frac{-g\sin\theta - 2\dot{r}\dot{\theta}}{r}$$

Here, $\ddot{\theta}$ is angular acceleration (rad/s²). The term $-g\sin\theta/r$ is the pendulum-like swing. The crucial coupling term $- 2\dot{r}\dot{\theta}/r$ appears because the changing length r affects angular momentum conservation. This term is the source of the energy transfer between bouncing and swinging.

Real-World Applications

Flexible Robot Arms & Cranes: Long, slender robotic arms or construction crane booms can flex and sway. Their dynamics are modeled as a series of coupled spring-pendulum segments. Engineers use these simulations to prevent destructive resonant oscillations during operation.

Atomic Force Microscopy (AFM): The AFM's microscopic cantilever tip scans surfaces. It's essentially a tiny, damped spring pendulum. Understanding its nonlinear resonance is critical for improving image resolution and measuring nanoscale forces.

Cable Structures & Tethers: The dynamics of suspended cables, mooring lines for ships, or tethers for space elevators involve coupled stretch and swing. Parametric resonance from wave or wind forces can lead to unexpected, large-amplitude motions that must be designed against.

Energy Harvesting Devices: Some prototypes use a spring pendulum mechanism to capture energy from ambient vibrations (like bridges or machinery). The chaotic, wide-frequency response of the system can make it efficient at harvesting energy from irregular real-world vibrations.

Common Misconceptions and Points to Note

First, you might tend to think that "a softer spring makes the pendulum's motion slower," but in reality, it's not that simple. While it's true that reducing the spring constant k makes the spring's extension and contraction slower, the period of the pendulum's swing is primarily determined by its initial length. If you make k extremely small, creating a "floppy" state, the extension/contraction and the swing become strongly coupled, sometimes resulting in motion that appears irregular. This isn't about the motion being slower; it's about it becoming more complex.

Next, a pitfall when setting parameters: do not confuse the "natural length L0" with the "initial length r0". The length of the spring at the start of the simulation is r0. For example, if you set L0=1.0m and r0=1.5m, the spring is initially at rest while stretched by 0.5m. If you gently release it from this state (zero initial velocity), the weight will begin pendulum motion while falling straight down—an unexpected movement. To create your intended initial state, be mindful of the relationship between r0 and L0.

Finally, regarding the interpretation of simulation results: it's crucial to understand that while the law of conservation of energy always holds in an ideal system without damping, the spring energy and the pendulum energy are not individually conserved. The essence of the system is that the two vigorously exchange energy over time. Even if the breakdown of energy fluctuates wildly on the graph, if the total sum remains constant, your simulation is working correctly. In reality, motion almost never starts from a state where energy is completely biased to one side.

How to Use

  1. Set initial spring length (vL0, range 0.1–1.0 m) and spring constant (vk, typical 10–500 N/m for lab springs)
  2. Define mass (vm, 0.05–2.0 kg) and initial angle (θ₀, −180° to +180°) to establish coupling between radial and angular motion
  3. Click Start to run 4th-order Runge–Kutta integration; observe real-time oscillation plots showing spring extension Δr and pendulum angle evolution
  4. Monitor Total Energy output for numerical stability; energy conservation indicates solver accuracy

Worked Example

Steel mass m=0.2 kg, spring k=85 N/m, initial length L₀=0.35 m, θ₀=45°. RK4 solver predicts coupled oscillation with period ≈1.8 s for radial stretch and ≈2.2 s angular swing (nonlinear coupling increases period vs. uncoupled estimates). Total energy E_initial ≈ 2.14 J splits between gravitational potential (mgh), elastic (½kΔr²), and kinetic (½m(ṙ² + r²θ̇²)) components. Spring reaches maximum extension Δr_max ≈ 0.082 m when pendulum passes near vertical.

Practical Notes

  1. Use low damping (0 for ideal case) to observe pure energy exchange between spring potential and kinetic modes; real systems need air/pivot friction terms
  2. Large initial angles (θ₀ > 60°) trigger nonlinear regime where radial–angular coupling dominates; linear pendulum theory fails above ~20°
  3. Monitor spring length constraint: simulator clips Δr to prevent compression if k is very stiff relative to gravitational force
  4. Chaotic behavior emerges for specific k/m and θ₀ combinations; energy plot divergence signals numerical step-size adjustment needed