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.
Swinging Atwood machine
With hanging coordinate \(r\) and swing angle \(\theta\):
3. Springs
Elastic pendulum
Using radial extension \(r\) and angle \(\theta\), the bob is \(\mathbf r=(r\sin\theta,-r\cos\theta)\). Therefore
4. Rolling 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
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. 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.
← Back to Mechanics