GLOBAL KNOWLEDGE ARK

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 chapter

After 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.
01

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.

02

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.

03

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.

Fixed interval L and fixed fundamental mode; force ratio is discrete amplitude divided by exact amplitude
Nh/LForce ratio R_NRelative amplitude error (%)
41/40.78539821.460184
81/80.9480595.194055
161/160.9871161.288420
321/320.9967850.321483
641/640.9991970.080332
04

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.

Separate fixed-spacing comparison; the common physical mode is k_* = 2π/L_*
Box length/L_*NMinimum k in π/L_*Nyquist k in π/L_*Common mode numberCommon-mode force ratio
11621610.987116
23211620.987116
Discrete force convergence and a separate finite-box comparisonA logarithmic error plot displays only the five supplied mesh tests N = 4,8,16,32,64, with circles for the actual discrete-operator errors. The exact discrete force-amplitude error is 100 times one minus (π/N) cotangent (π/N). A distinct dashed guide without data markers shows the leading small-spacing expression 100(π/N) squared divided by three. The connecting segments guide the eye between discrete tests and are not additional simulation runs. The table retains the exact force-ratio rounding, actual errors and leading-expression percentages. A separate fixed-spacing ruler compares box lengths L* and 2L*: their nonzero mode spacings are respectively 2 and 1 in units π/L*, their common physical k* = 2π/L* has the same numerical force ratio 0.987116, and both mesh Nyquist values are 16π/L*. A centered derivative vanishes at the Nyquist pattern, so representability is not an accuracy claim.Refinement and larger volume differFixed epoch, fixed L and mode k = 2π/L; a manufactured test.The source and both centered operators stay fixed.No simulation noise or observational uncertainty is shown.Exact discrete-operator errorLeading small-kh termA · Relative force-amplitude error (%) · logarithmic axes0.010.111010048163264Horizontal mesh N · connectors are guides between discrete testsNForce ratioError (%)Leading (%)40.78539821.46018420.56167680.9480595.1940555.140419160.9871161.2884201.285105320.9967850.3214830.321276640.9991970.0803320.080319B · A separate comparison fixes h = L*/16 and k* = 2π/L*.A larger box adds long modes; it does not refine this common mode.Box L*: N = 16, common mode number 102481216Box 2L*: N = 32, common mode number 202481216Horizontal wavenumber in π/L* · diamond is the common k*Common-mode R = 0.987116 in both boxes; k_min is 2 then 1.Both Nyquist values are 16π/L*, but centered force is zero there.A sampling bound is not an accuracy guarantee.
A logarithmic error plot displays only the five supplied mesh tests N = 4,8,16,32,64, with circles for the actual discrete-operator errors. The exact discrete force-amplitude error is 100 times one minus (π/N) cotangent (π/N). A distinct dashed guide without data markers shows the leading small-spacing expression 100(π/N) squared divided by three. The connecting segments guide the eye between discrete tests and are not additional simulation runs. The table retains the exact force-ratio rounding, actual errors and leading-expression percentages. A separate fixed-spacing ruler compares box lengths L* and 2L*: their nonzero mode spacings are respectively 2 and 1 in units π/L*, their common physical k* = 2π/L* has the same numerical force ratio 0.987116, and both mesh Nyquist values are 16π/L*. A centered derivative vanishes at the Nyquist pattern, so representability is not an accuracy claim. Fixed interval L and fixed fundamental mode; force ratio is discrete amplitude divided by exact amplitude. Columns: N; h/L; Force ratio R_N; Relative amplitude error (%). Rows: 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. Separate fixed-spacing comparison; the common physical mode is k_* = 2π/L_*. Columns: Box length/L_*; N; Minimum k in π/L_*; Nyquist k in π/L_*; Common mode number; Common-mode force ratio. Rows: 1; 16; 2; 16; 1; 0.987116 / 2; 32; 1; 16; 2; 0.987116. Additional native Leading (%) column: for N = 4, 8, 16, 32, 64, the leading-expression percentages are respectively 20.561676, 5.140419, 1.285105, 0.321276, 0.080319. These use the leading small-kh approximation 100(π/N)²/3 and are distinct from the exact discrete-operator errors.
05

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?

  1. The test mode has k_* = 2π/L_* in both boxes.
  2. Both use h = L_*/16, so k_*h = π/8 in both.
  3. 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

  1. 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.

  2. 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.

  3. 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.

  1. The cosmological simulation code GADGET-2Volker SpringelResearch paperarxiv.orgRead source
  2. Initial conditions to cosmological N-body simulations, or how to run an ensemble of simulationsEdwin SirkoResearch paperarxiv.orgRead source
  3. 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 paperarxiv.orgRead source
  4. 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 paperarxiv.orgRead source