Particle in a Cubic Potential
This simulation shows a particle moving in a cubic potential \(U(x) = x - \frac{1}{3}x^3\). The left canvas shows the potential energy landscape with a bowling ball representing the particle position. The right canvas shows the phase space trajectory \((x, v)\).
Adjust the initial position, velocity, and damping constant to explore different behaviors.
Numerical Method
The equation of motion is written as the first-order system \(\dot{x} = v,\ \dot{v} = -c\,v - (1 - x^2)\) and advanced with the classical 4th-order Runge-Kutta (RK4) method at a fixed step \(\Delta t = 0.01\). RK4 evaluates the slope four times per step and combines them in a weighted average, giving \(O(\Delta t^4)\) accuracy that resolves the nonlinear oscillations cleanly.
For strong damping (\(c > 10\)) the system becomes stiff and the explicit RK4 step can go unstable. The solver then switches to the implicit second-order backward differentiation formula (BDF2), \(y_{n+1} = \tfrac{4}{3}y_n - \tfrac{1}{3}y_{n-1} + \tfrac{2}{3}\Delta t\,f(y_{n+1})\), whose nonlinear update is solved each step with Newton's method. The first two steps are bootstrapped with RK4 to build the required history, and each Newton solve is seeded with a second-order linear-extrapolation predictor \(y_{n+1}^{(0)} = 2y_n - y_{n-1}\) for fast, robust convergence. This keeps the integration stable while the particle settles toward equilibrium.
\( \textcolor{midnightblue}{\textbf{Equation of Motion:}} \) \( \textcolor{maroon}{\ddot{x} + c \dot{x} + (1 - x^2) = 0, \quad x(0) = x_0, \quad \dot{x}(0) = v_0} \)
\( \textcolor{midnightblue}{\textbf{Potential Function:}} \) \( \textcolor{maroon}{U(x) = x - \dfrac{1}{3}x^3} \)
Cite this tool
Kapita, S. (2026). Particle in a Cubic Potential. Math Tools. https://shelvean.github.io/math-tools/potential.html
Kapita, Shelvean. "Particle in a Cubic Potential." Math Tools, 2026, shelvean.github.io/math-tools/potential.html.
@online{kapita2026potential,
author = {Shelvean Kapita},
title = {{Particle in a Cubic Potential}},
year = {2026},
organization = {Math Tools},
url = {https://shelvean.github.io/math-tools/potential.html}
}