Computational physics uses numerical algorithms to obtain and test predictions of physical models. It includes solving differential equations, simulating stochastic processes and extracting physical quantities from data. The mathematical model, its numerical approximation and its agreement with an experiment are separate questions: an accurately executed algorithm can still solve an unsuitable model.
A simple example is the harmonic oscillator . The explicit Euler method advances it by
For a unit mass, define . Direct substitution gives
The physical oscillator conserves energy, but this algorithm creates it on every step. The discrepancy is a numerical effect, not a discovery about the oscillator. Changing the time step and comparing with a known solution exposes the problem; for long integrations, the choice of numerical method matters as well as the size of the step.
Richard Feynman's lecture on planetary motion gives a concrete historical teaching example: forces determine accelerations, which update velocities and positions through successive arithmetic steps. A computer extends the same approach to systems whose coupled motion has no convenient closed expression.[ref] Conservation checks, comparison against solvable limits, and convergence under finer numerical resolution help distinguish a reliable calculation from an attractive plot. Agreement with measurements then tests the physical model itself.
Direct numerical simulation of a turbulent fluid numerically solves the specified governing equations while resolving the dynamically relevant turbulent and dissipative scales. It does not replace unresolved turbulent motions with a subgrid-scale model. The calculation still assumes a continuum model, boundary conditions and a finite numerical representation; direct does not mean exact or atomistic.
A published example solves the coupled velocity, thermal and compositional equations for fingering convection with a pseudospectral method and triply periodic perturbations. The authors explicitly require resolving the dissipation scale because they use no subgrid-scale model, and inspect composition and vorticity fields to assess resolution. The simulations inform a reduced transport prescription for stellar calculations, rather than resolving an entire star.[ref]
An exact laminar check helps explain numerical verification. For unforced incompressible Navier-Stokes equations with constant kinematic viscosity , take constant pressure and
in a periodic box containing whole wavelengths. The divergence vanishes and , so the equation reduces to . The mean kinetic energy per unit mass is therefore
A solver should recover this decay and energy budget under numerical refinement. Passing the check is useful but does not establish that a turbulent calculation resolves its smallest relevant scales. Direct numerical simulation also needs adequate box size, time resolution and statistical sampling.

Articles by others on the same topic (2)

Computational physics is a branch of physics that employs numerical methods and algorithms to solve complex physical problems that cannot be addressed analytically. It encompasses the use of computational techniques to simulate physical systems, model phenomena, and analyze data, thereby facilitating a deeper understanding of physical processes. Key aspects of computational physics include: 1. **Methodology**: This involves the development and implementation of algorithms to solve equations that arise from physical theories.
Computational physics by Ciro Santilli 40 Updated 2025-07-16
The intersection of two beautiful arts: coding and physics!
Computational physics is a good way to get valuable intuition about the key equations of physics, and train your numerical analysis skills: