Mechanics Mathematics
This page explains the mathematical model used by every mechanism in the simulator. Each system is described by generalized coordinates, its kinetic energy \(T\), its potential energy \(V\), and the Lagrangian \(L=T-V\).
1. The common method
A generalized coordinate \(q_i\) describes one independent way the system can move. Its velocity is \(\dot q_i=dq_i/dt\). The Euler-Lagrange equation for every coordinate is
The symbolic engine differentiates \(L\), collects the coefficients of the accelerations \(\ddot q_i\), and produces a linear system
The solver evaluates \(A\) and \(b\) at the current state, solves for the accelerations, and advances the state with fourth-order Runge-Kutta integration.
2. Pendulums
Simple pendulum
With \(\mathbf r=(l\sin\theta,-l\cos\theta)\):
Double pendulum
The two angles are measured from the downward vertical. The bob positions are
The equations are coupled because the kinetic energy contains both velocities. The solver solves the resulting \(2\times2\) system at every time step.
Spherical pendulum
The polar angle \(\theta\) and azimuth \(\phi\) locate the bob on a sphere of radius \(l\):
Since \(\phi\) does not appear in \(L\), it is cyclic. Its conjugate momentum is conserved:
Bead on a rotating hoop
A hoop rotates about its vertical diameter with prescribed angular speed \(\Omega\). For bead angle \(\theta\), the kinetic energy is
The \(\Omega^2\sin^2\theta\) term is the rotational kinetic energy caused by the hoop itself, and changes the equilibria.
Kapitza pendulum
The pivot height is prescribed as \(y_p=a\cos(\Omega t)\). The bob position is
\(L\) depends explicitly on time, so mechanical energy is not conserved. At sufficiently rapid vibration, the time-averaged dynamics can stabilize the normally unstable inverted position.
3. Springs and coupled oscillators
Elastic pendulum
Using radial extension \(r\) and angle \(\theta\), the bob is \(\mathbf r=(r\sin\theta,-r\cos\theta)\). Therefore
Coupled spring-mass chain \((x_1,x_2,x_3)\)
Three masses move horizontally, with identical springs attached to both walls and between neighboring masses. Displacements are measured from equilibrium:
The equations are
4. Rolling and constrained systems
Disk on a slope
The slope direction is \(\hat p=(2,-1)/\sqrt5\), and the disk center is \(\mathbf c=r\hat n+x\hat p\). Rolling without slipping gives \(\omega=\dot x/r\), so
Cart and pendulum
For cart displacement \(x\) and pendulum angle \(\theta\), the coupled energies are
Swinging Atwood machine
With hanging coordinate \(r\) and swing angle \(\theta\):
Rolling disk pendulum
The rolling disk pendulum has coordinates \(x,\theta_1,\theta_2\). Its kinetic energy is the sum of translational and rotational energies of the ring, inner disk, and pendulum masses:
Each spring contributes \(V_s=\frac12k(|\mathbf b-\mathbf a|-l_0)^2\), and gravity contributes \(mgy\). The simulator differentiates this complete expression symbolically rather than displaying its very long expanded equations.
5. Rotational systems
Symmetric spinning top
The top uses Euler angles \(\theta,\phi,\psi\). Here \(\theta\) is nutation, \(\phi\) is precession, and \(\psi\) is spin. With transverse inertia \(I_1\) and axial inertia \(I_3\):
Both \(\phi\) and \(\psi\) are absent from \(L\), so their momenta are conserved:
6. Numerical integration and conservation
The simulation advances time in small substeps. For state \(z=(q,\dot q)\), it evaluates
with classical fourth-order Runge-Kutta:
For time-independent systems, total energy \(E=T+V\) should remain nearly constant; small changes come from numerical integration. Cyclic coordinates provide additional conserved momenta, while the explicitly time-dependent Kapitza pendulum does not conserve energy.
← Back to Mechanics