Cosmology · Simulations, surveys and validation
Resolution, finite volumes and convergence
Refine a known periodic force calculation while holding its physical mode fixed, then enlarge the box in a separate comparison.
Preparation: ratios, powers of ten and ordinary arithmetic. Physical quantities and notation are introduced as they are needed.
Back to the chapterAfter reading, you can
- Distinguish mesh spacing from finite simulated volume.
- Calculate convergence of one specified force operator.
- Separate fixed-model refinement from recalibration and physical validation.
A finer mesh and a larger box change different things
Numerical resolution describes how finely a calculation represents its chosen system. Finite volume describes which spatial domain and long-wavelength modes the system can contain.
Increasing the number of samples at fixed box size can improve a numerical approximation. It does not create wavelengths longer than the box.
Increasing box size at fixed sample spacing admits additional long modes while preserving that spacing. It need not improve the accuracy for a particular physical mode already represented in both boxes.
Use a manufactured one-dimensional field at one epoch to see these distinctions exactly. This is a force-operator test, not an evolving cosmological N-body or hydrodynamical simulation.
Hold the physical problem fixed during refinement
At scale factor a = 1, supply dimensionless density contrast δ(x) = A cos(kx), with A = 0.1 and fundamental wavenumber k = 2π/L in a periodic interval of length L metres.
Supply positive coefficient g in s⁻² and equation d²φ/dx² = gδ. The potential φ has units m²/s² and its exact solution with zero mean is −gA cos(kx)/k².
The exact acceleration is −dφ/dx, with amplitude gA/k in m/s². Divide the interval into N equal mesh spacings h = L/N.
Use the centered three-point second difference to solve the potential and the centered first difference to compute acceleration. Keep the source, interval and these operators fixed as N increases.
Refinement approaches the known continuum answer
For this mode the discrete negative second-derivative eigenvalue is λ_h = 4sin²(kh/2)/h². The discrete potential is −gA cos(kx)/λ_h.
Combining this potential with the centered first derivative gives the force-amplitude ratio R = (kh/2)cot(kh/2). For the fundamental mode it becomes R_N = (π/N)cot(π/N).
At N = 8 the relative force-amplitude error is about 5.194055%; at N = 16 it is about 1.288420%. These deterministic errors are not simulation noise or measured cosmic uncertainties.
Optional expansion for small kh gives 1−R_N = (π/N)²/3 + O(N⁻⁴). The leading error therefore approaches a factor-of-four reduction when N doubles in that regime.
| N | h/L | Force ratio R_N | Relative amplitude error (%) |
|---|---|---|---|
| 4 | 1/4 | 0.785398 | 21.460184 |
| 8 | 1/8 | 0.948059 | 5.194055 |
| 16 | 1/16 | 0.987116 | 1.288420 |
| 32 | 1/32 | 0.996785 | 0.321483 |
| 64 | 1/64 | 0.999197 | 0.080332 |
A larger interval admits a different longest wavelength
Now perform a separate comparison at fixed spacing h = L_*/16 and fixed physical test mode k_* = 2π/L_*. Compare periodic lengths L_* and 2L_*.
The smaller interval uses N = 16 and contains the test mode as its fundamental. The larger interval uses N = 32 and contains the same physical test mode as its second harmonic.
Both have the same k_*h and the same force ratio 0.987116 for that mode. Their minimum allowed nonzero wavenumbers differ: 2π/L_* and π/L_*, respectively.
Both mesh Nyquist wavenumbers are π/h = 16π/L_*. This sampling limit is not an accuracy guarantee: at kh = π the centered first derivative vanishes, so a Nyquist-scale pattern has zero computed centered force.
| Box length/L_* | N | Minimum k in π/L_* | Nyquist k in π/L_* | Common mode number | Common-mode force ratio |
|---|---|---|---|---|---|
| 1 | 16 | 2 | 16 | 1 | 0.987116 |
| 2 | 32 | 1 | 16 | 2 | 0.987116 |
Convergence is conditional on the model and diagnostic
The first experiment tests discretization error for one smooth mode with fixed mathematical prescriptions. It does not establish time-step, particle-mass, force-softening or nonlinear convergence of a production simulator.
Changing unresolved-process parameters when changing resolution is a different comparison. The EAGLE methods paper distinguishes fixed-model strong convergence from weak convergence after recalibration.
Neither numerical convergence nor successful recalibration alone validates a physical model against observations. Iterative solver convergence is another separate issue: it concerns solving the chosen discrete equations accurately.
Report what stayed fixed, what changed and which observable was checked. No universal sufficient box size, resolution threshold or accuracy for all cosmological applications follows from this manufactured field.
Worked reasoning
Keep one physical mode fixed
Why do boxes of L_* and 2L_* have the same force error for k_* when h is fixed?
- The test mode has k_* = 2π/L_* in both boxes.
- Both use h = L_*/16, so k_*h = π/8 in both.
- The force ratio depends on k_*h and is about 0.987116, while the allowed longest wavelength differs.
The common mode sees the same numerical spacing; increasing volume changes which additional long modes are available.
Try the reasoning
If h is halved at fixed L, what happens to k_min?
Show the answer and reasoning
It remains 2π/L.
Mesh refinement changes sample spacing, not the periodic domain length.
Does representing a mode at kh = π guarantee an accurate centered force?
Show the answer and reasoning
No; the centered derivative is zero there.
A sampling bound is distinct from the accuracy of a particular numerical operator.
Is a resolution test with retuned subgrid parameters the same fixed-model comparison?
Show the answer and reasoning
No.
Recalibration changes the prescription and must be identified separately from fixed-prescription refinement.
What to carry forward
- Resolution and finite volume control different numerical limitations.
- A known solution can quantify one operator’s conditional convergence.
- Recalibration, iterative convergence and physical validation are separate tests.
References
Sources supporting the explanations, physical distinctions and examples in this lesson.
- The cosmological simulation code GADGET-2Volker SpringelResearch paper
- Initial conditions to cosmological N-body simulations, or how to run an ensemble of simulationsEdwin SirkoResearch paper
- The EAGLE project: Simulating the evolution and assembly of galaxies and their environmentsJoop Schaye; Robert A. Crain; Richard G. Bower; Michelle Furlong; Matthieu Schaller; Tom Theuns; Claudio Dalla Vecchia; Carlos S. Frenk; I. G. McCarthy; John C. Helly; Adrian Jenkins; Y. M. Rosas-Guevara; Simon D. M. White; Maarten Baes; C. M. Booth; Peter Camps; Julio F. Navarro; Yan Qu; Alireza Rahmati; Till Sawala; Peter A. Thomas; James TrayfordResearch paper
- On Validating an Astrophysical Simulation CodeA. C. Calder; B. Fryxell; T. Plewa; R. Rosner; L. J. Dursi; V. G. Weirs; T. Dupont; H. F. Robey; J. O. Kane; B. A. Remington; R. P. Drake; G. Dimonte; M. Zingale; F. X. Timmes; K. Olson; P. Ricker; P. MacNeice; H. M. TufoResearch paper