Eve library

phase-112.md

Tracker

Revision 1

On this page

Historical task source. The Eve task board holds current task state.

Phase 112: Kalika Classical & Continuum Physics — Classical Mechanics, Electrodynamics, Fluid Dynamics, Thermodynamics, Optics, Plasma Physics, Astrophysics & Nonlinear Dynamics#

Closes the most embarrassing gap in Kalika: a theoretical physics platform with no classical physics. Classical mechanics is the foundation of all physics — every graduate student learns Lagrangian/Hamiltonian mechanics before anything else. Classical electrodynamics (Maxwell's equations) is the most used physics in practice. Fluid dynamics is essential for astrophysics, plasma physics, and continuum mechanics. These are not advanced frontier topics — they are prerequisites. This phase ensures Kalika covers physics from Newton to Navier-Stokes, not just from Feynman to the amplituhedron.


112.1 Classical Mechanics (@kalika/classical-mechanics)#

112.1.1 Lagrangian Mechanics#

  • 112.1.1.1 Implement Lagrangian framework: given generalized coordinates q_i and a Lagrangian L(q, q-dot, t), automatically derive Euler-Lagrange equations d/dt(∂L/∂q-dot_i) - ∂L/∂q_i = 0, compute generalized momenta p_i = ∂L/∂q-dot_i, and identify cyclic coordinates (∂L/∂q_i = 0 → p_i conserved) — the symbolic derivation engine that every physics student needs
  • 112.1.1.2 Implement Noether's theorem for classical mechanics: given a continuous symmetry of the Lagrangian (time translation, space translation, rotation, boost, scaling), automatically compute the conserved quantity (energy, momentum, angular momentum, center-of-mass position, scaling charge) — with verification that dQ/dt = 0 on solutions
  • 112.1.1.3 Implement standard classical mechanics problems with full symbolic solutions: simple/compound pendulum, central force problem (orbits: Kepler, Bertrand's theorem), coupled oscillators (normal modes), rigid body dynamics (Euler angles, Euler equations, torque-free precession, symmetric top, sleeping top), small oscillation theory (linearization about equilibrium, eigenfrequency computation)
  • 112.1.1.4 Implement constraint handling: holonomic constraints (configuration space reduction via generalized coordinates), non-holonomic constraints (Lagrange multiplier method + d'Alembert's principle), and constraint force computation

112.1.2 Hamiltonian Mechanics#

  • 112.1.2.1 Implement Legendre transformation: given L(q, q-dot, t), compute the Hamiltonian H(q, p, t) = Σ p_i q-dot_i - L via symbolic Legendre transform, verify the transformation is well-defined (Hessian det(∂²L/∂q-dot_i ∂q-dot_j) ≠ 0), and derive Hamilton's equations dq_i/dt = ∂H/∂p_i, dp_i/dt = -∂H/∂q_i
  • 112.1.2.2 Implement Poisson bracket algebra: {f, g} = Σ(∂f/∂qi ∂g/∂p_i - ∂f/∂p_i ∂g/∂q_i), verify Jacobi identity, compute {q_i, p_j} = δ{ij}, time evolution df/dt = {f, H} + ∂f/∂t, and constants of motion identification ({C, H} = 0)
  • 112.1.2.3 Implement canonical transformations: generating function methods (F1(q,Q), F2(q,P), F3(p,Q), F4(p,P)), verification that transformation preserves Poisson brackets, and composition of canonical transformations
  • 112.1.2.4 Implement Hamilton-Jacobi theory: Hamilton-Jacobi equation ∂S/∂t + H(q, ∂S/∂q, t) = 0, separation of variables (identify separable coordinate systems for a given H), action-angle variables (I_i = ∮ p_i dq_i / 2π, θ_i) for integrable systems, and frequency computation ω_i = ∂H/∂I_i
  • 112.1.2.5 Implement Liouville integrability: given a Hamiltonian with n degrees of freedom, check for n independent integrals in involution ({F_i, F_j} = 0), construct action-angle variables via Arnold-Liouville theorem, and identify when a system is superintegrable

112.1.3 Perturbation Theory & KAM#

  • 112.1.3.1 Implement canonical perturbation theory: Lie series method for near-integrable Hamiltonians H = H_0(I) + εH_1(I, θ), compute perturbation corrections to action-angle variables order-by-order, handle small denominators (near-resonance), and compute frequency shifts — the standard tool for celestial mechanics and accelerator physics
  • 112.1.3.2 Implement Birkhoff normal form computation: near an elliptic fixed point, compute the normalizing transformation to arbitrary order using Lie transforms, identify resonant terms that cannot be removed, and compute stability estimates — essential for KAM theory applications and accelerator beam dynamics
  • 112.1.3.3 Implement frequency analysis (NAFF algorithm — Laskar): given a numerical trajectory, extract fundamental frequencies and their amplitudes with superconvergent accuracy, detect frequency drift (Arnold diffusion), and compute frequency maps — the numerical tool for studying near-integrable dynamics
  • 112.1.3.4 Implement KAM theory interface: given a near-integrable system, identify Diophantine conditions on frequency vectors, compute KAM tori numerically (parameterization method — de la Llave), and verify persistence using interval arithmetic — connecting to @kalika/numerical-engine for verified dynamics

112.1.4 Celestial Mechanics#

  • 112.1.4.1 Implement N-body gravitational dynamics: numerical integration of N gravitating point masses with adaptive time-stepping (Bulirsch-Stoer or symplectic), regularization for close encounters (Kustaanheimo-Stiefel for 2-body, chain regularization for multiple), and energy/angular momentum monitoring
  • 112.1.4.2 Implement restricted three-body problem: Jacobi integral, Lagrange points L1-L5, stability analysis (Floquet), zero-velocity curves, halo orbits, and manifold computation for space mission design
  • 112.1.4.3 Implement secular perturbation theory: orbit-averaged evolution of Keplerian elements under perturbations (Laplace-Lagrange secular theory for planetary systems), Kozai-Lidov mechanism for hierarchical triples, and general relativistic corrections (perihelion precession)

112.2 Classical Electrodynamics (@kalika/electrodynamics)#

112.2.1 Maxwell's Equations#

  • 112.2.1.1 Implement Maxwell's equations in all standard formulations: differential form (∇·E = ρ/ε₀, ∇×B - μ₀ε₀∂E/∂t = μ₀J, ∇·B = 0, ∇×E + ∂B/∂t = 0), integral form, potential formulation (A, φ with gauge freedom), covariant 4-vector formulation (F^μν, J^μ, ∂_μ F^μν = μ₀ J^ν), and differential form language (F = dA, dF = 0, d*F = *J) — with automatic conversion between formulations
  • 112.2.1.2 Implement electrostatic/magnetostatic solvers: Poisson equation (-∇²φ = ρ/ε₀) via Green's function (point charge, line charge, surface charge), method of images (conducting planes, spheres), separation of variables (Cartesian, cylindrical, spherical), and multipole expansion (monopole, dipole, quadrupole, general 2^l-pole)
  • 112.2.1.3 Implement electromagnetic wave solutions: plane waves, spherical waves, cylindrical waves, wave packets, polarization (Jones calculus, Stokes parameters, Mueller matrices), reflection/refraction (Fresnel equations), diffraction (Fraunhofer, Fresnel, Kirchhoff), and waveguide modes (TE, TM, TEM)
  • 112.2.1.4 Implement radiation theory: Larmor formula (non-relativistic radiated power), Lienard-Wiechert potentials (retarded fields of a moving charge), synchrotron radiation (relativistic circular motion), bremsstrahlung, Cherenkov radiation, and multipole radiation (electric/magnetic dipole, quadrupole patterns and power)
  • 112.2.1.5 Implement electromagnetic Green's functions: retarded/advanced Green's function for the wave equation, Dyadic Green's functions for vector wave equation, and their application to antenna theory and scattering problems

112.2.2 Computational Electrodynamics#

  • 112.2.2.1 Implement FDTD (Finite-Difference Time-Domain) solver: Yee grid staggering of E and H fields, leapfrog time-stepping, absorbing boundary conditions (PML — perfectly matched layer), and source injection (total-field/scattered-field) — the standard numerical method for electromagnetic wave simulation
  • 112.2.2.2 Implement electromagnetic multipole expansion: given a charge/current distribution, compute the multipole moments (electric: q, pi, Q{ij}, ...; magnetic: m_i, ...) and the resulting far-field radiation pattern — essential for antenna theory and atomic physics transitions

112.3 Fluid Dynamics (@kalika/fluid-dynamics)#

  • 112.3.1.1 Implement Navier-Stokes equations (incompressible): ∂u/∂t + (u·∇)u = -∇p/ρ + ν∇²u + f, ∇·u = 0, with standard formulations (primitive variable, vorticity-streamfunction, pressure-Poisson) and boundary conditions (no-slip, free-slip, periodic, inflow/outflow)
  • 112.3.1.2 Implement Euler equations (inviscid): compressible (conservation form: mass, momentum, energy) and incompressible, with Riemann solver (exact and approximate: HLLC, Roe) for shock-capturing — the foundation of computational gas dynamics
  • 112.3.1.3 Implement standard fluid solutions: Poiseuille flow (pipe/channel), Couette flow (shear), Stokes flow (creeping flow around sphere), Blasius boundary layer, Rayleigh-Benard convection, Taylor-Couette flow, von Karman vortex street — analytical and numerical reference solutions
  • 112.3.1.4 Implement vortex dynamics: point vortices in 2D (Kirchhoff's equations, N-vortex Hamiltonian), vortex filaments (Biot-Savart law, local induction approximation), and vortex sheet roll-up — used in turbulence research and aerodynamics
  • 112.3.1.5 Implement basic turbulence models: Reynolds-averaged Navier-Stokes (RANS) with k-epsilon model, large-eddy simulation (LES) with Smagorinsky SGS model, and direct numerical simulation (DNS) interface — for applications in astrophysical turbulence, plasma turbulence, and engineering
  • 112.3.1.6 Implement shallow water equations: 2D flow with free surface, conservation form (h, hu, hv), Riemann solver, and well-balanced schemes for bathymetry — relevant for geophysical fluid dynamics
  • 112.3.1.7 Implement ideal MHD equations: mass + momentum + energy + magnetic induction (∂B/∂t = ∇×(u×B)), divergence cleaning (∇·B = 0 enforcement via projection or hyperbolic cleaning), Alfven/magnetosonic wave solutions, and MHD Riemann solver — essential for astrophysics (accretion disks, stellar winds, ISM) and plasma physics

112.4 Thermodynamics (@kalika/thermodynamics)#

  • 112.4.1.1 Implement thermodynamic potentials: internal energy U(S,V,N), enthalpy H(S,P,N), Helmholtz free energy F(T,V,N), Gibbs free energy G(T,P,N) with automatic Legendre transform relations, Maxwell relations (∂²F/∂T∂V = ∂²F/∂V∂T → (∂S/∂V)_T = (∂P/∂T)_V), and stability conditions (C_V > 0, κ_T > 0)
  • 112.4.1.2 Implement equations of state: ideal gas (PV = nRT), van der Waals, Redlich-Kwong, Peng-Robinson, virial expansion, and tabulated EOS for real materials (water/steam via IAPWS-IF97, nuclear matter for neutron stars) — with automatic computation of all thermodynamic quantities from EOS
  • 112.4.1.3 Implement phase diagrams: Clausius-Clapeyron equation for phase boundaries, critical point identification, spinodal decomposition, Maxwell construction (equal-area rule for van der Waals), and multi-component phase diagrams (binary eutectic, solid solution)
  • 112.4.1.4 Implement thermodynamic cycles: Carnot, Otto, Diesel, Rankine, Brayton, refrigeration cycles — with T-S and P-V diagram generation, efficiency computation, and irreversibility analysis

112.5 Optics (@kalika/optics)#

  • 112.5.1.1 Implement geometric/ray optics: ray tracing through optical systems (lenses, mirrors, prisms), paraxial approximation (ABCD matrix method for Gaussian beam propagation), aberration theory (Seidel aberrations), and optical system design utilities
  • 112.5.1.2 Implement Fourier optics: Fraunhofer and Fresnel diffraction via FFT, optical transfer function (OTF/MTF), spatial filtering, holography principles, and Fourier transform pairs for standard apertures (slit, circular, Gaussian)
  • 112.5.1.3 Implement nonlinear optics: second harmonic generation (SHG), parametric amplification/oscillation, four-wave mixing, self-phase modulation, coupled-wave equations, and phase-matching conditions — relevant for laser physics and quantum optics experiments

112.6 Plasma Physics (@kalika/plasma-physics)#

  • 112.6.1.1 Implement plasma dispersion relation solver: given a plasma equilibrium (density, temperature, magnetic field profiles), compute wave modes by solving the dispersion relation det(D(ω,k)) = 0 for electromagnetic (O-mode, X-mode), electrostatic (Langmuir, ion acoustic), and magnetohydrodynamic (Alfven, magnetosonic, whistler) waves
  • 112.6.1.2 Implement Vlasov equation solver: particle distribution function f(x, v, t) evolution via ∂f/∂t + v·∂f/∂x + (q/m)(E + v×B)·∂f/∂v = 0, with PIC (Particle-in-Cell) method and continuum Vlasov (semi-Lagrangian, spectral) — for kinetic plasma simulations
  • 112.6.1.3 Implement ideal and resistive MHD equilibrium: Grad-Shafranov equation for axisymmetric MHD equilibria (tokamak geometry), force balance J×B = ∇p, magnetic flux surfaces, and safety factor q(ψ) — fundamental for fusion plasma physics
  • 112.6.1.4 Implement plasma transport: Spitzer resistivity, Braginskii transport equations, neoclassical transport (banana/plateau/Pfirsch-Schluter regimes), and anomalous transport models — for connecting to fusion and astrophysical plasma applications

112.7 Astrophysics (@kalika/astrophysics)#

  • 112.7.1.1 Implement stellar structure equations: hydrostatic equilibrium (dP/dr = -Gρm/r²), mass continuity (dm/dr = 4πr²ρ), energy transport (radiative: dT/dr via opacity, convective: adiabatic gradient with mixing length theory), and nuclear energy generation (pp chain, CNO cycle, triple-alpha, with parametric rate formulas) — a simplified stellar structure solver providing the physics that MESA implements in full
  • 112.7.1.2 Implement TOV (Tolman-Oppenheimer-Volkoff) equation solver: relativistic stellar structure for neutron stars, with tabulated nuclear equations of state (SLy, AP4, BSK, MPA1), mass-radius relation computation, tidal deformability (Love number k_2 via Hinderer's equation), and maximum mass determination — directly connecting to gravitational wave parameter estimation
  • 112.7.1.3 Implement accretion disk models: Shakura-Sunyaev thin disk (α-disk: temperature profile T(r), luminosity, spectrum), slim disk (advection-dominated), ADAF (advection-dominated accretion flow), and relativistic corrections (Novikov-Thorne for Kerr geometry) — essential for X-ray binary and AGN physics
  • 112.7.1.4 Implement compact object physics: white dwarf structure (Chandrasekhar mass from degenerate electron EOS), neutron star crust models (BPS EOS), magnetar spindown, pulsar timing (timing model, period derivatives, braking index), and black hole thermodynamics (Hawking temperature, Bekenstein entropy, Page time)
  • 112.7.1.5 Interface with MESA (via subprocess): for users needing full stellar evolution capabilities beyond simplified models, provide an interface to submit MESA inlists, run MESA, and import results (evolutionary tracks, internal profiles, pulsation frequencies) into Kalika for analysis and visualization

112.8 Nonlinear Dynamics & Chaos (@kalika/nonlinear-dynamics)#

  • 112.8.1.1 Implement dynamical systems framework: given a system dx/dt = f(x) or x_{n+1} = F(x_n), compute fixed points, classify stability (eigenvalues of Jacobian: nodes, spirals, saddles, centers), bifurcation detection (saddle-node, transcritical, pitchfork, Hopf, period-doubling, Neimark-Sacker), and bifurcation diagram construction (parameter sweep with stability tracking)
  • 112.8.1.2 Implement Lyapunov exponent computation: maximum Lyapunov exponent (from trajectory divergence), full Lyapunov spectrum (QR decomposition method / Benettin algorithm), and Kaplan-Yorke dimension — the quantitative measure of chaos
  • 112.8.1.3 Implement Poincaré section and return map: given a continuous flow, compute Poincaré sections (intersection with a codimension-1 surface), construct return maps, identify periodic orbits, and visualize stroboscopic maps — the essential tool for analyzing periodic/quasiperiodic/chaotic motion
  • 112.8.1.4 Implement fractal computation: Mandelbrot set (escape-time algorithm with distance estimation for smooth rendering), Julia sets (for arbitrary rational maps), iterated function system (IFS) fractals, fractal dimension computation (box-counting, correlation dimension, Hausdorff via coverings), and Lyapunov fractal
  • 112.8.1.5 Implement standard chaotic systems: Lorenz (σ=10, r=28, b=8/3), Rossler, double pendulum, Henon map, logistic map, standard map (Chirikov), kicked rotor, driven Duffing oscillator, coupled oscillator networks — all with pre-configured parameters, Lyapunov exponents, and visualization templates
  • 112.8.1.6 Implement route-to-chaos analysis: period-doubling cascade (Feigenbaum universality: δ = 4.6692..., α = 2.5029...), quasiperiodic route (golden mean, frequency locking, Arnold tongues), intermittency (types I, II, III), and crisis (boundary, interior) — with automatic detection from time series data

112.9 Atomic & Molecular Physics (@kalika/atomic-physics)#

  • 112.9.1.1 Implement Hartree-Fock for multi-electron atoms: self-consistent field (SCF) method with central-field approximation, Slater determinant wavefunctions, direct and exchange integrals, configuration assignment (electron shell filling), and term symbol computation (LS coupling: ²S+¹L_J) — the starting point for all atomic structure beyond hydrogen
  • 112.9.1.2 Implement atomic spectroscopy: transition rates (electric dipole, magnetic dipole, electric quadrupole), selection rules from matrix element symmetry, oscillator strengths, Einstein A/B coefficients, line shapes (natural, Doppler, Voigt), and Zeeman/Stark effect (perturbative splitting in external fields)
  • 112.9.1.3 Implement molecular physics basics: Born-Oppenheimer approximation (separate electronic and nuclear motion), LCAO-MO (linear combination of atomic orbitals for molecular orbitals), Hückel theory for conjugated systems, and molecular symmetry (point groups, character tables, selection rules from group theory)

112.10 Tests#

  • 112.10.1.1 Write classical mechanics tests: verify Kepler orbit period matches T² = 4π²a³/GM, harmonic oscillator normal mode frequencies for coupled systems, Euler top precession rate, Hamilton-Jacobi solution for Kepler problem matches Keplerian action-angle variables — minimum 100 test cases
  • 112.10.1.2 Write electrodynamics tests: verify Coulomb field, magnetic dipole field, Larmor radiated power formula, Fresnel reflection coefficients, and waveguide cutoff frequencies — minimum 60 test cases
  • 112.10.1.3 Write fluid dynamics tests: verify Poiseuille flow velocity profile, Blasius boundary layer similarity solution, Kelvin-Helmholtz instability growth rate, and MHD Alfven wave speed — minimum 40 test cases
  • 112.10.1.4 Write nonlinear dynamics tests: verify Lorenz attractor Lyapunov exponents (λ₁ ≈ 0.906), logistic map Feigenbaum constants, Poincaré section of Henon-Heiles system — minimum 30 test cases
  • 112.10.1.5 Write astrophysics tests: verify Chandrasekhar mass (1.44 M☉ for μ_e=2), TOV maximum mass for SLy EOS, Shakura-Sunyaev disk temperature profile T∝r^{-3/4} — minimum 20 test cases