Classical Mechanics
The foundation of physics describing motion and forces, from Newton's laws to the elegant formulations of Lagrange and Hamilton.
Journey Through Classical Mechanics
Starting with the Basics
Building Powerful Tools
Advanced Frameworks
- Lagrangian Mechanics: Freedom from Forces
- Hamiltonian Mechanics: The Geometry of Motion
- Modern Perspectives
Deeper Understanding
The Foundation: Newton’s Revolution
Before Newton, motion was a mystery. Objects moved, but why? Newton’s genius was recognizing that motion follows precise mathematical laws. Let’s build our understanding from the ground up.
Newton’s Laws of Motion
Paper: Philosophiæ Naturalis Principia Mathematica - Isaac Newton
Video: Newton's Laws of Motion Explained
The foundation of classical mechanics is built upon Newton’s three laws of motion:
Article: Newton's Laws of Motion - Wikipedia
First Law (Law of Inertia)
An object at rest stays at rest and an object in motion stays in motion with the same speed and in the same direction unless acted upon by an unbalanced force.
Mathematical Expression: \(If \Sigma F = 0, then v = constant\)
Second Law (Law of Acceleration)
The acceleration of an object is directly proportional to the net force acting on it and inversely proportional to its mass.
Mathematical Expression: \(F = ma\) Where:
- F = net force (N)
- m = mass (kg)
- a = acceleration (m/s²)
Third Law (Action-Reaction)
For every action, there is an equal and opposite reaction.
Mathematical Expression: \(F₁₂ = -F₂₁\)
Why Newton’s Laws Matter
These three simple laws explain an incredible range of phenomena:
- Why you lurch forward when a car brakes suddenly (First Law)
- How rockets work in the vacuum of space (Third Law)
- Why heavier objects don’t fall faster (Second Law with gravity)
But as powerful as Newton’s laws are, they have a limitation: you need to know all the forces. What if the forces are complicated? What if you don’t care about forces at all, just motion? This is where our journey gets interesting.
Conservation Laws: Nature’s Hidden Symmetries
Lecture: Conservation of Energy - Feynman Lectures
Here’s where physics gets elegant. Instead of tracking forces at every instant, we can use conservation laws—quantities that remain constant throughout motion. It’s like having a bank account that never changes its total balance, even as money moves between checking and savings.
These conservation laws aren’t arbitrary; they reflect deep symmetries in nature:
Click to expand: Interactive Conservation Laws Demonstration
Conservation laws are fundamental principles that remain constant in isolated systems:
- Energy Conservation: Total energy (kinetic + potential) remains constant
- Momentum Conservation: Total momentum is conserved in collisions
- Angular Momentum Conservation: Rotational momentum is preserved
Conservation of Energy
The total energy of an isolated system remains constant over time.
Types of Energy:
- Kinetic Energy: KE = ½mv²
- Potential Energy: PE = mgh (gravitational)
- Elastic Potential Energy: PE = ½kx²
Conservation Equation: \(\begin{aligned} E_{ ext{initial}} = E_{ ext{final}} KE_{ ext{i}} + PE_{ ext{i}} = KE_{ ext{f}} + PE_{ ext{f}} \end{aligned}\)
Conservation of Momentum
Tutorial: Momentum Conservation in Collisions
The total momentum of an isolated system remains constant.
Linear Momentum: \(p = mv\)
Conservation Equation: \(\Sigma p_{ ext{initial}} = \Sigma p_{ ext{final}}\)
Conservation of Angular Momentum
The total angular momentum of an isolated system remains constant.
Angular Momentum: \(L = I\omega = r \times p\)
Where:
- I = moment of inertia
- ω = angular velocity
- r = position vector
- p = linear momentum
The Power of Conservation
Conservation laws often provide shortcuts to solving problems. Consider a figure skater spinning: when she pulls her arms in, she spins faster. Why? Angular momentum (L = Iω) must stay constant. Decreasing I (moment of inertia) means ω (angular velocity) must increase. No forces needed—just conservation!
But even conservation laws have limitations when dealing with constraints and complex systems. This leads us to a revolutionary approach…
Kinematics: Describing Motion
From Observation to Mathematics
Now that we understand forces through Newton’s laws, let’s step back and look at motion itself. How do we describe where things are and how fast they’re moving? This is kinematics—the language of motion.
Kinematics describes motion without asking “why?”—that’s dynamics. It’s like studying the choreography of a dance without worrying about the muscles involved.
One-Dimensional Motion
Position: x(t)
Velocity: v = dx/dt
Acceleration: a = dv/dt = d²x/dt²
Equations of Motion (Constant Acceleration)
- v = v₀ + at
- x = x₀ + v₀t + ½at²
- v² = v₀² + 2a(x - x₀)
- x = x₀ + ½(v + v₀)t
Projectile Motion
Interactive: Projectile Motion Simulator - PhET
For projectile motion under constant gravitational acceleration:
Horizontal Motion: \(\begin{aligned} x = v₀ₓt vₓ = v₀ₓ (constant) \end{aligned}\)
Vertical Motion: \(\begin{aligned} y = v₀ᵧt - ½gt^2 vᵧ = v₀ᵧ - gt \end{aligned}\)
Range Formula: \(R = (v₀^2sin(2\theta ))/g\)
Maximum Height: \(H = (v₀^2sin^2(\theta ))/(2g)\)
Dynamics: Forces in Action
Connecting Force to Motion
While kinematics describes motion, dynamics explains it. This is where Newton’s second law (F = ma) becomes our primary tool. But as we’ll see, thinking in terms of energy often provides a more elegant approach.
Dynamics bridges the gap between abstract forces and observable motion:
Work and Energy
Work: The energy transferred to or from an object via the application of force along a displacement.
\[W = F·d = Fd cos(\theta )\]For variable force: \(W = ∫F·dr\)
Power
Power is the rate at which work is done:
\[P = dW/dt = F·v\]Simple Harmonic Motion
Code: SHM Animation with Matplotlib
Objects that experience a restoring force proportional to displacement exhibit simple harmonic motion.
Hooke’s Law: \(F = -kx\)
Equation of Motion: \(x(t) = A cos(\omega t + φ)\)
Where:
- A = amplitude
- ω = angular frequency = √(k/m)
- φ = phase constant
Period: \(T = 2\pi /\omega = 2\pi √(m/k)\)
Rotational Motion: Beyond Point Particles
Why Rotation Matters
So far, we’ve treated objects as point particles. But real objects have size and shape. They can spin, roll, and tumble. This adds richness to mechanics—and complexity.
The beautiful discovery: rotational motion follows the same patterns as linear motion, just with different quantities:
Mermaid Diagram: Linear vs Rotational Motion Analogy
```mermaid graph LR subgraph Linear Motion A[Position x] --> B[Velocity v = dx/dt] B --> C[Acceleration a = dv/dt] D[Mass m] --> E[Force F = ma] F[Momentum p = mv] end subgraph Rotational Motion G[Angular Position θ] --> H[Angular Velocity ω = dθ/dt] H --> I[Angular Acceleration α = dω/dt] J[Moment of Inertia I] --> K[Torque τ = Iα] L[Angular Momentum L = Iω] end A -.->|Analogy| G B -.->|Analogy| H C -.->|Analogy| I D -.->|Analogy| J E -.->|Analogy| K F -.->|Analogy| L ```
Rotational Kinematics
Analogous to linear motion:
- Angular position: θ
- Angular velocity: ω = dθ/dt
- Angular acceleration: α = dω/dt
Moment of Inertia
Reference: Moment of Inertia Tables
The rotational equivalent of mass:
Point Mass: \(I = mr^2\)
Common Shapes:
- Solid sphere: I = (2/5)MR²
- Solid cylinder: I = (1/2)MR²
- Thin rod (center): I = (1/12)ML²
Torque
The rotational equivalent of force:
\[\tau = r \times F = rF \sin(\theta)\]Rotational Newton’s Second Law: \(\tau = I\alpha\)
Gravitation: The First Unified Theory
From Falling Apples to Orbiting Planets
Newton’s greatest triumph wasn’t just explaining how things move—it was recognizing that the force pulling an apple to Earth is the same force keeping the Moon in orbit. This was humanity’s first “unified theory,” connecting terrestrial and celestial mechanics.
Newton’s Law of Universal Gravitation
Paper: Principia - Book III: The System of the World
Tutorial: Understanding Universal Gravitation
Every particle attracts every other particle with a force:
\[F = \frac{Gm_1m_2}{r^2}\]Where:
- G = 6.674 × 10⁻¹¹ N·m²/kg² (gravitational constant)
- m₁, m₂ = masses of the objects
- r = distance between centers
Orbital Motion
For circular orbits:
Orbital Velocity: \(v = \sqrt{\frac{GM}{r}}\)
Orbital Period: \(T = 2\pi\sqrt{\frac{r^3}{GM}}\)
This is Kepler’s Third Law for circular orbits.
Oscillations and Waves: Patterns in Motion
The Universality of Oscillations
Look around: pendulum clocks tick, guitar strings vibrate, atoms in solids jiggle. Oscillatory motion is everywhere because it emerges whenever there’s a restoring force—something that pushes a system back toward equilibrium.
But real oscillations don’t last forever…
Damped Oscillations
When friction is present:
\[m\ddot{x} + b\dot{x} + kx = 0\]Solutions depend on the damping coefficient b:
- Underdamped: Oscillates with decreasing amplitude
- Critically damped: Returns to equilibrium fastest
- Overdamped: Returns to equilibrium without oscillating
Wave Motion
Wave Equation: \(\frac{\partial^2 y}{\partial t^2} = v^2 \frac{\partial^2 y}{\partial x^2}\)
Wave Speed: \(v = f\lambda\)
Where:
- f = frequency
- λ = wavelength
Lagrangian Mechanics: A New Perspective
Beyond Forces: Why We Need Lagrangian Mechanics
Imagine trying to analyze a bead sliding on a curved wire. With Newton’s laws, you’d need to constantly track the constraint force from the wire—a mathematical nightmare. Lagrange asked a brilliant question: what if we could ignore constraint forces entirely?
The answer revolutionized physics. Instead of thinking about forces, Lagrange focused on energy and the path a system takes through its possible configurations.
The Principle of Least Action
Here’s the profound insight: Nature is lazy. Among all possible paths between two points, a system follows the path that minimizes (or extremizes) a quantity called “action”:
Action:
\[S = \int_{t_1}^{t_2} L(q, \dot{q}, t) \, dt\]Where $L = T - V$ is the Lagrangian (kinetic minus potential energy).
The Magic: This single principle replaces F = ma and automatically handles constraints!
Euler-Lagrange Equations: \(\frac{d}{dt}\left(\frac{\partial L}{\partial \dot{q}_i}\right) - \frac{\partial L}{\partial q_i} = 0\)
These equations provide a powerful alternative to Newton’s laws. No constraint forces appear—they’re automatically accounted for by choosing appropriate coordinates.
Generalized Coordinates: Freedom from Cartesian Tyranny
Here’s another liberation: we’re not stuck with x, y, z coordinates. Use whatever coordinates make the problem simple!
Examples:
- Pendulum? Use the angle θ instead of (x, y)
- Particle on a sphere? Use spherical coordinates (θ, φ)
- Double pendulum? Use two angles (θ₁, θ₂)
For a system with n degrees of freedom:
- Configuration space: Q = {q₁, q₂, …, qₙ} - all possible positions
- Generalized momentum: pᵢ = ∂L/∂q̇ᵢ - not always mass × velocity!
- Phase space: Γ = {q₁, …, qₙ, p₁, …, pₙ} - positions and momenta together
Constraints and Lagrange Multipliers
Holonomic constraints: f(q₁, …, qₙ, t) = 0
Modified Lagrangian with constraints: \(L' = L + \sum_i \lambda_i f_i(q, t)\)
Noether’s Theorem: The Deep Connection
Emmy Noether discovered one of the most profound results in physics: every symmetry in nature corresponds to a conservation law. This isn’t coincidence—it’s fundamental to how the universe works.
The Symmetry-Conservation Dictionary:
| Symmetry | Conservation Law |
|---|---|
| Time translation | Energy |
| Space translation | Linear momentum |
| Rotation | Angular momentum |
| Gauge invariance | Charge |
Mathematical Statement: If the action is invariant under $q_i \to q_i + \varepsilon\xi_i(q)$, then: \(Q = \sum_i \frac{\partial L}{\partial \dot{q}_i}\xi_i = \text{constant}\)
Example: Double Pendulum - Where Newton Struggles
The double pendulum perfectly illustrates why we need Lagrangian mechanics. With Newton’s approach, you’d need to track tension forces in both rods, which constantly change direction. With Lagrange? Just write down the energy:
def double_pendulum_lagrangian(theta1, theta2, theta1_dot, theta2_dot,
m1, m2, l1, l2, g):
"""Lagrangian for double pendulum - no constraint forces needed!"""
# Kinetic energy - just from velocities
T = 0.5*m1*(l1*theta1_dot)**2 + 0.5*m2*((l1*theta1_dot)**2 +
(l2*theta2_dot)**2 + 2*l1*l2*theta1_dot*theta2_dot*
np.cos(theta1-theta2))
# Potential energy - just from positions
V = -m1*g*l1*np.cos(theta1) - m2*g*(l1*np.cos(theta1) +
l2*np.cos(theta2))
return T - V # That's it! Equations of motion follow automatically
The Limitation of Lagrangian Mechanics
Lagrangian mechanics is powerful, but it still thinks in terms of trajectories through configuration space. What if we want to think more abstractly about the state of a system? What if we want to understand the geometry of all possible motions? What if we want to connect classical mechanics to quantum mechanics?
These questions led Hamilton to reformulate mechanics once again, creating a framework so elegant and powerful that it remains central to theoretical physics today…
Hamiltonian Mechanics: The Ultimate Abstraction
From Configuration Space to Phase Space
Hamilton realized that instead of thinking about positions and velocities, we should think about positions and momenta as independent variables. This seems like a minor change, but it revolutionizes our perspective.
Why the change? In phase space:
- The evolution of a system becomes a flow
- Conservation laws become geometric properties
- The connection to quantum mechanics becomes clear
Hamilton’s Equations: Beautiful Symmetry
The Hamiltonian H typically represents total energy: \(H(q, p, t) = \sum_i p_i\dot{q}_i - L(q, \dot{q}, t)\)
Hamilton’s Canonical Equations: \(\dot{q}_i = \frac{\partial H}{\partial p_i}, \quad \dot{p}_i = -\frac{\partial H}{\partial q_i}\)
Phase Space: Where Physics Becomes Geometry
In phase space, a system’s state is a single point. As time evolves, this point traces a path. But here’s the beautiful part: phase space has structure.
Liouville’s Theorem: Phase space volume is preserved by time evolution \(\frac{d\rho}{dt} + \{\rho, H\} = 0\)
This means if you start with a blob of initial conditions, the blob might deform and stretch, but its volume never changes. It’s like incompressible fluid flow—a deep connection between mechanics and fluid dynamics!
Poisson Brackets: The Language of Classical Mechanics
Poisson brackets are to classical mechanics what commutators are to quantum mechanics. They encode how quantities change with time and relate to each other:
\[\{f, g\} = \sum_i \left(\frac{\partial f}{\partial q_i}\frac{\partial g}{\partial p_i} - \frac{\partial f}{\partial p_i}\frac{\partial g}{\partial q_i}\right)\]Properties:
- Antisymmetry: {f, g} = -{g, f}
- Linearity: {af + bg, h} = a{f, h} + b{g, h}
- Jacobi identity: {f, {g, h}} + {g, {h, f}} + {h, {f, g}} = 0
Time evolution: df/dt = {f, H} + ∂f/∂t
Canonical Transformations
Transformations preserving Hamilton’s equations: \(Q = Q(q, p, t), \quad P = P(q, p, t)\)
Generating functions:
- Type 1: $F_1(q, Q, t) \rightarrow p = \partial F_1/\partial q$, $P = -\partial F_1/\partial Q$
- Type 2: $F_2(q, P, t) \rightarrow p = \partial F_2/\partial q$, $Q = \partial F_2/\partial P$
- Type 3: $F_3(p, Q, t) \rightarrow q = -\partial F_3/\partial p$, $P = -\partial F_3/\partial Q$
- Type 4: $F_4(p, P, t) \rightarrow q = -\partial F_4/\partial p$, $Q = \partial F_4/\partial P$
Symplectic structure: Canonical transformations preserve the 2-form: \(\omega = \sum_i dp_i \wedge dq_i = \sum_i dP_i \wedge dQ_i\)
Action-Angle Variables
For integrable systems, transform to (I, θ) where:
- Action variables: Iᵢ = ∮ pᵢ dqᵢ/(2π)
- Angle variables: θᵢ with period 2π
- Hamilton’s equations: İᵢ = 0, θ̇ᵢ = ωᵢ(I) = ∂H/∂Iᵢ
Hamilton-Jacobi Theory: The Final Synthesis
Unifying Particles and Waves
The Hamilton-Jacobi equation represents the culmination of classical mechanics. It reformulates mechanics in terms of a single function S (the action), which satisfies a partial differential equation. This might seem like unnecessary abstraction, but it reveals something profound: classical mechanics has a wave-like character!
Hamilton-Jacobi Equation
The action S(q, t) satisfies: \(\frac{\partial S}{\partial t} + H\left(q, \frac{\partial S}{\partial q}, t\right) = 0\)
Complete solution: S = S(q, α, t) + const
Where α are n constants of integration.
New momenta: Pᵢ = αᵢ = constant New coordinates: Qᵢ = ∂S/∂αᵢ = βᵢ + ωᵢt
Separation of Variables
For separable systems: \(S = W(q) - Et\)
Time-independent HJ equation: \(H\left(q, \frac{\partial W}{\partial q}\right) = E\)
The Bridge to Quantum Mechanics
Here’s where Hamilton’s genius shines. The mathematical structure of classical mechanics—Poisson brackets, phase space, canonical transformations—carries over almost unchanged to quantum mechanics. Just replace:
- Poisson brackets {A, B} → Commutators [Â, B̂]/(iℏ)
- Phase space points → Wave functions
- Trajectories → Probability amplitudes
In the classical limit (ℏ → 0): \(\psi = \exp(iS/\hbar)\)
The quantum wave function reduces to classical action! This deep connection shows that classical and quantum mechanics aren’t separate theories—they’re different aspects of a unified framework.
When Predictability Breaks Down: Chaos
The End of the Clockwork Universe
For centuries after Newton, physicists believed the universe was deterministic—if you knew initial conditions perfectly, you could predict the future forever. Then came a shocking discovery: even simple classical systems can be unpredictable.
Chaos Theory and Nonlinear Dynamics
Lyapunov Exponents
Measure of sensitivity to initial conditions: \(\lambda = \lim_{t \to \infty} \frac{1}{t} \ln\left(\frac{|\delta Z(t)|}{|\delta Z_0|}\right)\)
Chaotic system: At least one positive Lyapunov exponent.
Poincaré Sections
Reduce continuous dynamics to discrete map:
- Choose surface of section Σ
- Record intersections of trajectory with Σ
- Study resulting discrete map
KAM Theory: Order in Chaos
Just when chaos seems to destroy all hope of understanding, KAM theory provides comfort. Even in chaotic systems, islands of regularity persist.
Kolmogorov-Arnold-Moser theorem: Small perturbations can’t destroy everything
- Most quasi-periodic orbits survive (slightly deformed)
- Chaos is confined to specific regions
- Regular and chaotic motion coexist
The surprising result: The solar system is mostly stable despite being chaotic! KAM theory explains why planets haven’t collided after billions of years.
Mathematical Statement: For an integrable Hamiltonian H₀(I) perturbed by εH₁(I,θ), if:
- The frequency map ω(I) = ∂H₀/∂I is non-degenerate: det(∂²H₀/∂I²) ≠ 0
- The perturbation ε is sufficiently small
-
The frequencies satisfy a Diophantine condition: ω·k ≥ γ/ k ^τ for all k ∈ ℤⁿ{0}
Then most invariant tori with irrational frequency ratios persist.
Applications:
- Asteroid Belt Stability: Kirkwood gaps where resonances destroy orbits
- Particle Accelerators: Beam stability in storage rings
- Plasma Confinement: Magnetic surfaces in fusion reactors
Strange Attractors
Lorenz system: \(\dot{x} = \sigma(y - x), \quad \dot{y} = x(\rho - z) - y, \quad \dot{z} = xy - \beta z\)
Properties:
- Fractal dimension
- Sensitive dependence on initial conditions
- Bounded but non-periodic
Modern Perspectives: Geometry Rules
Why Geometry?
As we’ve climbed from Newton to Lagrange to Hamilton, we’ve increasingly seen that mechanics is really about geometry. Forces are vectors, energy is a scalar, but phase space has rich geometric structure. Modern physics embraces this geometric viewpoint.
Symplectic Geometry: The Natural Language
Symplectic manifold: (M, ω) where ω is a closed, non-degenerate 2-form.
Canonical coordinates: ω = Σᵢ dpᵢ ∧ dqᵢ
Darboux’s theorem: All symplectic manifolds locally look the same.
Fiber Bundles and Gauge Theory
Configuration space: Q (base manifold) Phase space: T*Q (cotangent bundle) Lagrangian mechanics: On TQ (tangent bundle)
Connection 1-form: Describes parallel transport Curvature 2-form: F = dA + A ∧ A
Geometric Phases
Berry phase: For cyclic evolution: \(\gamma = i\oint \langle\psi|\nabla_R|\psi\rangle \cdot dR\)
Hannay angle: Classical analog of Berry phase Foucault pendulum: Example of geometric phase
From Theory to Practice: Modern Applications
The abstract frameworks we’ve developed aren’t just mathematical elegance—they’re essential for modern technology and science:
Molecular Dynamics
def verlet_integration(positions, velocities, forces, dt, mass):
"""Velocity Verlet algorithm for MD simulation"""
# Update positions
positions += velocities * dt + 0.5 * forces/mass * dt**2
# Calculate new forces
forces_new = calculate_forces(positions)
# Update velocities
velocities += 0.5 * (forces + forces_new)/mass * dt
return positions, velocities, forces_new
Celestial Mechanics
N-body problem: No general analytical solution for N ≥ 3
Restricted three-body problem:
- Lagrange points (L1-L5)
- Stable (L4, L5) and unstable (L1-L3) equilibria
- Applications: space mission design
Plasma Physics
Vlasov equation: \(\frac{\partial f}{\partial t} + \mathbf{v} \cdot \nabla_x f + \frac{q}{m}(\mathbf{E} + \mathbf{v} \times \mathbf{B}) \cdot \nabla_v f = 0\)
Kinetic theory: Bridge between particle and fluid descriptions
Computational Methods: Respecting the Physics
The Numerical Challenge
Computers can’t solve differential equations exactly—they take small steps. But naive methods gradually violate conservation laws, leading to unphysical results. The solution? Use the geometric structure!
Symplectic Integrators: Preserving What Matters
Preserve phase space structure:
def symplectic_euler(q, p, H, dt):
"""First-order symplectic integrator"""
p_new = p - dt * grad_q(H, q, p)
q_new = q + dt * grad_p(H, q, p_new)
return q_new, p_new
def stormer_verlet(q, p, H, dt):
"""Second-order symplectic integrator"""
p_half = p - 0.5*dt * grad_q(H, q, p)
q_new = q + dt * grad_p(H, q, p_half)
p_new = p_half - 0.5*dt * grad_q(H, q_new, p_half)
return q_new, p_new
Variational Integrators: Discrete Mechanics Done Right
Remember how Lagrangian mechanics came from minimizing action? Variational integrators apply this principle directly to discrete time steps. Instead of discretizing differential equations (which can introduce errors), we discretize the action principle itself.
The result: perfect conservation of discrete momentum and energy, even for very long simulations. This is how we can accurately simulate the solar system for millions of years! \(S_d = \sum_k L_d(q_k, q_{k+1}, h)\)
Discrete Euler-Lagrange equations: \(D_2 L_d(q_{k-1}, q_k) + D_1 L_d(q_k, q_{k+1}) = 0\)
The Living Edge of Classical Mechanics
You might think classical mechanics is a “finished” subject, but research continues at the frontiers:
Quantum-Classical Correspondence
Ehrenfest theorem: ⟨x⟩ satisfies classical equations WKB approximation: Semi-classical limit Coherent states: Minimal uncertainty wave packets
Integrability and Solitons
Lax pairs: L̇ = [L, M] Inverse scattering: Solve nonlinear PDEs Toda lattice: Exactly solvable many-body system
Topological Mechanics
Topological invariants: Chern numbers, winding numbers Edge states: Protected by topology Applications: Mechanical metamaterials
Machine Learning Meets Mechanics
The newest frontier: using AI to discover physical laws from data. But there’s a catch—naive neural networks don’t respect physics. The solution? Build physical principles into the architecture:
Neural ODEs: Learn dynamics from data while guaranteeing smooth evolution Hamiltonian neural networks: Neural nets that automatically conserve energy Physics-informed neural networks: Incorporate PDEs as constraints
These approaches let us discover governing equations from observations—essentially automating what took humans centuries to develop!
Recent Breakthroughs (2023-2024):
- Lagrangian Neural Networks: Directly learn Lagrangian L(q,q̇) from data, guaranteeing energy conservation
- Geometric Deep Learning: Neural networks on manifolds preserving symplectic structure
- AI Feynman 2.0: Symbolic regression discovering analytical physics equations
- Graph Neural Networks: Learning many-body interactions from particle trajectories
Example: Learning Unknown Forces
import torch
import torch.nn as nn
class LagrangianNN(nn.Module):
"""Neural network that learns the Lagrangian from data"""
def __init__(self, q_dim):
super().__init__()
self.net = nn.Sequential(
nn.Linear(2*q_dim, 128),
nn.Softplus(),
nn.Linear(128, 128),
nn.Softplus(),
nn.Linear(128, 1)
)
def forward(self, q, q_dot):
"""Returns learned Lagrangian L(q, q̇)"""
return self.net(torch.cat([q, q_dot], dim=-1))
def get_accelerations(self, q, q_dot):
"""Derive accelerations using Euler-Lagrange equations"""
L = self.forward(q, q_dot)
# Compute ∂L/∂q and ∂L/∂q̇
dL_dq = torch.autograd.grad(L.sum(), q, create_graph=True)[0]
dL_dq_dot = torch.autograd.grad(L.sum(), q_dot, create_graph=True)[0]
# Time derivative of ∂L/∂q̇
d_dt_dL_dq_dot = torch.autograd.grad(
(dL_dq_dot * q_dot).sum(), q, create_graph=True
)[0]
# Euler-Lagrange: q̈ = (∂L/∂q - d/dt(∂L/∂q̇)) / (∂²L/∂q̇²)
return dL_dq - d_dt_dL_dq_dot
Advanced Mathematical Tools
Differential Geometry
Tangent bundle: TM = ∪ₓ TₓM Cotangent bundle: TM = ∪ₓ TₓM Lie derivatives: ℒ_X Y = [X, Y]
Lie Groups and Algebras
Momentum map: J: M → g* Coadjoint orbits: Symplectic manifolds Reduction: Quotient by symmetry group
Category Theory
Classical mechanics as functor:
- Objects: Configuration spaces
- Morphisms: Canonical transformations
- Composition: Sequential transformations
References and Further Reading
Graduate Textbooks
- Goldstein, Poole & Safko - Classical Mechanics (3rd Edition)
- Arnold - Mathematical Methods of Classical Mechanics
- Landau & Lifshitz - Mechanics (Course of Theoretical Physics Vol. 1)
- José & Saletan - Classical Dynamics: A Contemporary Approach
Research Monographs
- Marsden & Ratiu - Introduction to Mechanics and Symmetry
- Abraham & Marsden - Foundations of Mechanics
- Ott - Chaos in Dynamical Systems
- Tabor - Chaos and Integrability in Nonlinear Dynamics
Recent Research Directions
- Geometric Mechanics: Port-Hamiltonian systems, discrete mechanics
- Quantum-Classical Hybrid Systems: Decoherence, measurement
- Machine Learning: Data-driven discovery of conservation laws
- Topological Mechanics: Mechanical metamaterials, protected states
- Stochastic Mechanics: Noise-induced phenomena, large deviations
Applications
Engineering Applications
- Bridge Design: Using statics to calculate load distributions
- Vehicle Dynamics: Analyzing forces during acceleration and turning
- Machinery: Designing gears, pulleys, and mechanical systems
Everyday Examples
- Sports: Trajectory of a basketball, golf ball, or baseball
- Transportation: Car acceleration, braking distances
- Amusement Parks: Forces experienced on roller coasters
Astronomical Applications
- Satellite Orbits: Calculating orbital parameters
- Planetary Motion: Predicting positions of planets
- Space Missions: Trajectory planning for spacecraft
When Classical Mechanics Fails
The Boundaries of the Classical World
As powerful as classical mechanics is, nature has surprises that require new physics:
Classical mechanics breaks down in several regimes:
- High Speeds: When velocities approach the speed of light, time dilates and mass increases—enter special relativity
- Small Scales: At atomic scales, particles exhibit wave-like behavior—enter quantum mechanics
- Strong Gravitational Fields: Near black holes, space and time curve—enter general relativity
- Many Particles: With 10²³ particles, statistical mechanics becomes necessary
But here’s the beautiful part: the mathematical structures we’ve developed—Lagrangians, Hamiltonians, symmetries—carry over to these new theories. Classical mechanics isn’t wrong; it’s the limiting case of deeper theories.
Advanced Code Examples
Double Pendulum Chaos Visualization
import numpy as np
from scipy.integrate import solve_ivp
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
def double_pendulum_derivatives(t, state, m1, m2, l1, l2, g):
"""Compute derivatives for double pendulum using Lagrangian mechanics"""
theta1, z1, theta2, z2 = state # Use z for angular velocity
c, s = np.cos(theta1 - theta2), np.sin(theta1 - theta2)
den1 = (m1 + m2)*l1 - m2*l1*c*c
den2 = (l2/l1)*den1
dydt = np.zeros_like(state)
dydt[0] = z1 # dtheta1/dt
dydt[2] = z2 # dtheta2/dt
# Lagrangian dynamics
num1 = -m2*l1*z1*z1*s*c + m2*g*np.sin(theta2)*c + \
m2*l2*z2*z2*s - (m1 + m2)*g*np.sin(theta1)
dydt[1] = num1/den1
num2 = -m2*l2*z2*z2*s*c + (m1 + m2)*g*np.sin(theta1)*c - \
(m1 + m2)*l1*z1*z1*s - (m1 + m2)*g*np.sin(theta2)
dydt[3] = num2/den2
return dydt
# Parameters
m1 = m2 = 1.0
l1 = l2 = 1.0
g = 9.81
# Initial conditions - small perturbation shows chaos
theta1_0 = np.pi/2
theta2_0 = np.pi/2
z1_0 = 0
z2_0 = 0
# Solve for two slightly different initial conditions
state0_1 = [theta1_0, z1_0, theta2_0, z2_0]
state0_2 = [theta1_0 + 0.001, z1_0, theta2_0, z2_0] # Small perturbation
t_span = (0, 20)
t_eval = np.linspace(*t_span, 2000)
sol1 = solve_ivp(double_pendulum_derivatives, t_span, state0_1,
args=(m1, m2, l1, l2, g), t_eval=t_eval,
method='DOP853', rtol=1e-10)
sol2 = solve_ivp(double_pendulum_derivatives, t_span, state0_2,
args=(m1, m2, l1, l2, g), t_eval=t_eval,
method='DOP853', rtol=1e-10)
# Plot phase space and divergence
fig, axes = plt.subplots(2, 2, figsize=(12, 10))
# Phase space trajectories
ax = axes[0, 0]
ax.plot(sol1.y[0], sol1.y[1], 'b-', alpha=0.7, label='Original')
ax.plot(sol2.y[0], sol2.y[1], 'r-', alpha=0.7, label='Perturbed')
ax.set_xlabel(r'$\theta_1$')
ax.set_ylabel(r'$\dot{\theta}_1$')
ax.set_title('Phase Space: Pendulum 1')
ax.legend()
ax.grid(True, alpha=0.3)
# Poincaré section
ax = axes[0, 1]
# Sample when theta2 crosses zero with positive velocity
crossings = np.where(np.diff(np.sign(sol1.y[2])) > 0)[0]
ax.scatter(sol1.y[0][crossings], sol1.y[1][crossings], c='b', s=10, alpha=0.5)
ax.set_xlabel(r'$\theta_1$')
ax.set_ylabel(r'$\dot{\theta}_1$')
ax.set_title('Poincaré Section')
ax.grid(True, alpha=0.3)
# Lyapunov exponent estimation
ax = axes[1, 0]
divergence = np.sqrt((sol1.y[0] - sol2.y[0])**2 +
(sol1.y[1] - sol2.y[1])**2)
log_divergence = np.log(divergence + 1e-15)
ax.semilogy(sol1.t, divergence)
ax.set_xlabel('Time (s)')
ax.set_ylabel('Phase Space Distance')
ax.set_title('Sensitive Dependence on Initial Conditions')
ax.grid(True, alpha=0.3)
# Energy conservation check
ax = axes[1, 1]
# Calculate total energy
theta1, z1, theta2, z2 = sol1.y
c = np.cos(theta1 - theta2)
T = 0.5*m1*(l1*z1)**2 + 0.5*m2*((l1*z1)**2 + (l2*z2)**2 +
2*l1*l2*z1*z2*c)
V = -m1*g*l1*np.cos(theta1) - m2*g*(l1*np.cos(theta1) +
l2*np.cos(theta2))
E = T + V
ax.plot(sol1.t, E - E[0], 'g-')
ax.set_xlabel('Time (s)')
ax.set_ylabel('Energy Error')
ax.set_title('Energy Conservation')
ax.grid(True, alpha=0.3)
plt.tight_layout()
plt.show()
# Estimate Lyapunov exponent
from scipy import stats
# Linear fit to log divergence in growth region
t_fit = sol1.t[100:500] # Avoid initial transient and saturation
log_div_fit = log_divergence[100:500]
slope, intercept, r_value, p_value, std_err = stats.linregress(t_fit, log_div_fit)
print(f"Estimated Lyapunov exponent: {slope:.4f} s^-1")
print(f"R-squared: {r_value**2:.4f}")
Symplectic Integration Comparison
def hamiltonian_pendulum(q, p, m=1, l=1, g=9.81):
"""Hamiltonian for simple pendulum"""
return p**2/(2*m*l**2) + m*g*l*(1 - np.cos(q))
def euler_step(q, p, H, dt):
"""Standard Euler method (not symplectic)"""
dH_dq = (H(q + 1e-8, p) - H(q, p))/1e-8
dH_dp = (H(q, p + 1e-8) - H(q, p))/1e-8
q_new = q + dt * dH_dp
p_new = p - dt * dH_dq
return q_new, p_new
def symplectic_euler_step(q, p, H, dt):
"""Symplectic Euler method"""
dH_dq = (H(q + 1e-8, p) - H(q, p))/1e-8
p_new = p - dt * dH_dq
dH_dp = (H(q, p_new + 1e-8) - H(q, p_new))/1e-8
q_new = q + dt * dH_dp
return q_new, p_new
def leapfrog_step(q, p, H, dt):
"""Leapfrog/Störmer-Verlet method"""
dH_dq = (H(q + 1e-8, p) - H(q, p))/1e-8
p_half = p - 0.5*dt * dH_dq
dH_dp = (H(q, p_half + 1e-8) - H(q, p_half))/1e-8
q_new = q + dt * dH_dp
dH_dq_new = (H(q_new + 1e-8, p_half) - H(q_new, p_half))/1e-8
p_new = p_half - 0.5*dt * dH_dq_new
return q_new, p_new
# Compare integrators
q0, p0 = 3.0, 0.0 # Large amplitude
dt = 0.1
n_steps = 10000
# Storage for trajectories
trajectories = {
'Euler': {'q': [q0], 'p': [p0], 'E': []},
'Symplectic Euler': {'q': [q0], 'p': [p0], 'E': []},
'Leapfrog': {'q': [q0], 'p': [p0], 'E': []}
}
# Run simulations
for method, integrator in [('Euler', euler_step),
('Symplectic Euler', symplectic_euler_step),
('Leapfrog', leapfrog_step)]:
q, p = q0, p0
for _ in range(n_steps):
q, p = integrator(q, p, hamiltonian_pendulum, dt)
trajectories[method]['q'].append(q)
trajectories[method]['p'].append(p)
trajectories[method]['E'].append(hamiltonian_pendulum(q, p))
# Plot results
fig, axes = plt.subplots(1, 3, figsize=(15, 5))
# Phase space
ax = axes[0]
for method, style in [('Euler', 'r-'), ('Symplectic Euler', 'g-'),
('Leapfrog', 'b-')]:
traj = trajectories[method]
ax.plot(traj['q'], traj['p'], style, alpha=0.7, label=method)
ax.set_xlabel(r'$\theta$')
ax.set_ylabel(r'$p_\theta$')
ax.set_title('Phase Space Trajectories')
ax.legend()
ax.grid(True, alpha=0.3)
# Energy conservation
ax = axes[1]
t = np.arange(n_steps + 1) * dt
E0 = hamiltonian_pendulum(q0, p0)
for method, style in [('Euler', 'r-'), ('Symplectic Euler', 'g-'),
('Leapfrog', 'b-')]:
E = np.array([E0] + trajectories[method]['E'])
ax.semilogy(t, np.abs(E - E0) + 1e-16, style, label=method)
ax.set_xlabel('Time')
ax.set_ylabel('Energy Error')
ax.set_title('Energy Conservation')
ax.legend()
ax.grid(True, alpha=0.3)
# Phase space area preservation
ax = axes[2]
for method, color in [('Euler', 'red'), ('Symplectic Euler', 'green'),
('Leapfrog', 'blue')]:
traj = trajectories[method]
# Sample points in phase space
q_vals = np.array(traj['q'][::100])
p_vals = np.array(traj['p'][::100])
ax.scatter(q_vals[:50], p_vals[:50], c=color, alpha=0.6,
label=f'{method} (early)', s=30)
ax.scatter(q_vals[-50:], p_vals[-50:], c=color, alpha=0.6,
marker='x', label=f'{method} (late)', s=30)
ax.set_xlabel(r'$\theta$')
ax.set_ylabel(r'$p_\theta$')
ax.set_title('Phase Space Volume Preservation')
ax.legend(bbox_to_anchor=(1.05, 1), loc='upper left')
ax.grid(True, alpha=0.3)
plt.tight_layout()
plt.show()
Simulating Projectile Motion with Python
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
def projectile_motion(v0, angle, g=9.81, dt=0.01):
"""Simulate projectile motion"""
# Convert angle to radians
theta = np.radians(angle)
# Initial conditions
vx = v0 * np.cos(theta)
vy = v0 * np.sin(theta)
# Lists to store trajectory
x_vals = [0]
y_vals = [0]
t_vals = [0]
# Simulate until projectile hits ground
x, y, t = 0, 0, 0
while True:
t += dt
x += vx * dt
y += vy * dt
vy -= g * dt
if y < 0:
break
x_vals.append(x)
y_vals.append(y)
t_vals.append(t)
return np.array(x_vals), np.array(y_vals), np.array(t_vals)
# Create visualization
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 5))
# Plot trajectory for different angles
angles = [30, 45, 60, 75]
v0 = 20 # Initial velocity (m/s)
for angle in angles:
x, y, t = projectile_motion(v0, angle)
ax1.plot(x, y, label=f'{angle}°')
# Calculate range and max height
range_val = x[-1]
max_height = np.max(y)
print(f"Angle: {angle}°, Range: {range_val:.2f}m, Max Height: {max_height:.2f}m")
ax1.set_xlabel('Distance (m)')
ax1.set_ylabel('Height (m)')
ax1.set_title('Projectile Motion for Different Launch Angles')
ax1.legend()
ax1.grid(True, alpha=0.3)
# Energy conservation demonstration
x, y, t = projectile_motion(v0, 45)
vx = v0 * np.cos(np.radians(45))
vy_initial = v0 * np.sin(np.radians(45))
vy = vy_initial - 9.81 * t
# Calculate energies
mass = 1 # kg
KE = 0.5 * mass * (vx**2 + vy**2)
PE = mass * 9.81 * y
TE = KE + PE
ax2.plot(t, KE, label='Kinetic Energy')
ax2.plot(t, PE, label='Potential Energy')
ax2.plot(t, TE, label='Total Energy', linestyle='--')
ax2.set_xlabel('Time (s)')
ax2.set_ylabel('Energy (J)')
ax2.set_title('Energy Conservation in Projectile Motion')
ax2.legend()
ax2.grid(True, alpha=0.3)
plt.tight_layout()
plt.show()
Expected Output
The code produces two plots:
- Left plot shows parabolic trajectories for different launch angles (30°, 45°, 60°, 75°)
- Right plot demonstrates energy conservation with constant total energy throughout the motion
Tutorial: Advanced Matplotlib Plotting Techniques
Problem-Solving Strategies
Interactive Problem-Solving Flowchart
```mermaid flowchart TD A[Start: Physics Problem] --> B{Identify System} B --> C[List Known Variables] C --> D[List Unknown Variables] D --> E{Choose Method} E -->|Forces| F[Draw Free Body Diagram] E -->|Energy| G[Identify Energy Types] E -->|Momentum| H[Check if Isolated System] F --> I[Apply Newton's Laws] G --> J[Apply Conservation of Energy] H --> K[Apply Conservation of Momentum] I --> L[Solve Equations] J --> L K --> L L --> M{Check Units} M -->|Wrong| N[Fix Unit Errors] N --> L M -->|Correct| O{Is Answer Reasonable?} O -->|No| P[Review Assumptions] P --> B O -->|Yes| Q[Solution Complete!] style A fill:#f9f,stroke:#333,stroke-width:2px style Q fill:#9f9,stroke:#333,stroke-width:2px ```
- Identify the System: Clearly define what objects are involved
- Draw Diagrams: Free body diagrams for forces, motion diagrams for kinematics
- Choose Coordinate System: Select axes that simplify the problem
- List Known/Unknown: Organize given information and what needs to be found
- Select Appropriate Equations: Use conservation laws when applicable
- Check Units: Ensure dimensional consistency
- Verify Reasonableness: Does the answer make physical sense?
Historical Context
Classical mechanics was developed over centuries:
- Galileo Galilei (1564-1642): Studied motion and inertia
- Isaac Newton (1643-1727): Formulated the laws of motion and gravitation
- Leonhard Euler (1707-1783): Developed analytical mechanics
- Joseph-Louis Lagrange (1736-1813): Created Lagrangian mechanics
- William Rowan Hamilton (1805-1865): Developed Hamiltonian mechanics
These developments laid the foundation for modern physics and engineering.
Continue Your Journey
Where to Go From Here
Classical mechanics is both an endpoint and a beginning. It’s complete in itself, yet it opens doors to all of modern physics. Whether you’re interested in engineering applications, theoretical physics, or computational methods, the foundations you’ve learned here will serve you well.
Essential Resources
Book: The Feynman Lectures on Physics, Volume I
Course: MIT 8.01 Classical Mechanics
Video Series: Classical Mechanics - Walter Lewin
Library: SymPy - Symbolic Mathematics in Python
See Also
Natural Next Steps:
- Quantum Mechanics - Where classical mechanics meets the microscopic world
- Statistical Mechanics - From Newton’s laws to thermodynamics
- Relativity - When speeds approach c or gravity gets strong
Applied Directions:
- Computational Physics - Numerical methods for solving complex mechanical systems
- Thermodynamics - Energy and heat in mechanical systems
- Condensed Matter Physics - Mechanics of materials
- String Theory - Classical mechanics in higher dimensions