Computational Physics

University Physics · Advanced Placement

Computational Physics: the big picture

Most physical problems have no closed-form solution, so numerical methods are not an optional extra but the normal route to an answer. Numerical differentiation approximates a derivative by a finite difference, with the central difference far more accurate than a forward difference for the same step size, and the choice of step involves a trade-off between truncation error, which falls as the step shrinks, and round-off error, which grows. Numerical integration by the trapezium or Simpson's rule converges at rates that depend on the smoothness of the integrand. Ordinary differential equations are integrated forward in time by stepping methods: the Euler method is simplest but accumulates error quickly and does not conserve energy for oscillatory systems, while higher-order Runge–Kutta methods and symplectic integrators such as velocity Verlet behave far better for mechanics, which is why molecular dynamics and orbital propagation use them. Root finding by bisection is slow but certain, while Newton's method converges quadratically when it converges at all. Monte Carlo methods use random sampling to evaluate high-dimensional integrals and to simulate statistical systems, with accuracy improving as the square root of the sample count. Every numerical result requires validation: a convergence study, a comparison with an analytic limit, and a check of conserved quantities.

Finite Differences, Integration & Stepping Differential Equations

Most physics problems have no closed-form answer, so numerical methods are the normal route rather than a fallback. A central difference approximates a derivative far better than a forward difference at the same step size, and choosing the step means balancing truncation error, which shrinks with the step, against round-off error, which grows. For differential equations, the Euler method is simple but leaks energy badly in oscillatory systems, which is why orbital and molecular dynamics codes use symplectic integrators that conserve it.

{{illustration:phys-l31-f1}}

{{illustration:phys-l31-f2}}

Key relations

- Finite differences and Simpson's rule. f′(x) ≈ (f(x+h) − f(x−h))/2h ; ∫ₐ^b f ≈ h/3(f₀ + 4f₁ + 2f₂ + ⋯ + fₙ)

Monte Carlo Methods, Random Sampling & Validation

Monte Carlo methods evaluate integrals and simulate systems by random sampling, and their accuracy improves as the square root of the sample count regardless of how many dimensions the problem has. That dimension independence is what makes them indispensable in statistical mechanics and in radiation transport, where grid methods would need exponentially many points. The discipline around them matters as much as the method: every result needs a convergence study, a comparison against an analytic limit, and a check that conserved quantities are conserved.

{{illustration:phys-l31-f3}}

{{illustration:phys-l31-f4}}

Key relations

- Monte Carlo estimation and its error. ∫ f ≈ V/N∑ᵢ₌₁^N f(xᵢ) ; σₑₛₜ = (σ_f)/(√(N)) ; ∫ f = ∫ f/p p dx