GLOBAL KNOWLEDGE ARK

Astronomy · Testing models against the sky

Analytical models and numerical simulations

Separate the mathematical problem, its computed solution and its comparison with observations through an exact integration and refinement example.

Continue in the approved chapter order. Necessary vocabulary, quantities and assumptions are explained in the lesson.

Back to the chapter

After reading, you can

  • Identify the assumptions and predicted observables in analytical and numerical models.
  • Distinguish implementation and solution verification from empirical validation for an intended use.
  • Calculate a refinement error and explain why reducing it need not remove a reference discrepancy.
01

More computation does not supply missing physics

An analytical model expresses relationships that can be studied symbolically or with controlled approximations. A numerical simulation computes consequences through algorithms, finite steps, grids or samples. Both begin with choices about what physical processes to represent, what to omit and which observables to predict.

State the variables, units, parameter range, initial or boundary conditions and relevant observing process. An astronomical simulation of a system and a synthetic image of that system are not the same object: predicting a detector image also needs propagation, response, resolution, noise and selection assumptions.

A detailed simulation and a simple analytical approximation can share an omitted physical effect. Their agreement then supports a bounded comparison between those calculations, not independent proof that the shared physical assumptions are correct. A realistic-looking rendering similarly needs a scientific test beyond visual resemblance.

Separate the conceptual or mathematical model from its implementation and from one computed result. An error can enter at any of these levels, and the appropriate check depends on where the claim is being made.

02

Check the calculation and the intended physical use separately

In scientific modelling, implementation verification asks whether the program implements its declared equations and design. Solution verification concerns the accuracy of a particular computed solution, including discretization, incomplete iteration and finite-precision effects. Empirical validation compares relevant model predictions with observations or other justified referents for an intended use.

NASA-STD-7009B distinguishes those roles and their domains. The distinction is useful for astronomy without implying that this lesson certifies compliance with that standard. A model can pass a numerical check over one domain while failing to represent an astronomical system adequately in another.

Calibration or tuning adjusts model parameters to improve agreement with a referent. The data used for that adjustment contribute development information; they do not automatically become an independent test of predictive adequacy. Keep this modelling use of calibration clear alongside its measurement-science meaning.

The following original dimensionless example lets us inspect a computed answer against an exact mathematical result, then compare it with a separately assigned reference. No astronomical observation, instrument performance or experimental uncertainty is supplied.

03

An exact integral exposes numerical discretization error

Let u be a dimensionless coordinate from zero to one, and define f(u) = 2 + u². Its exact integral is I = integral from 0 to 1 of f(u) du = 2 + 1/3 = 7/3. We want the numerical calculation to approximate this stated mathematical quantity.

Divide the interval into N equal subintervals of width h = 1/N and evaluate each at its midpoint. The composite midpoint estimate is IN = (1/N)Σi=0 to N−1 [2 + ((i + 1/2)/N)²]. All quantities in this particular example are dimensionless.

For this quadratic, each subinterval’s exact integral exceeds its midpoint rectangle by h³/12. Summing N subintervals gives I − IN = Nh³/12 = h²/12 = 1/(12N²). Halving h therefore quarters the error exactly in exact arithmetic.

The table lists four computed midpoint values and their positive errors relative to 7/3. Their orderly refinement verifies this calculation against the prescribed problem. It does not yet compare a physical model with a real astronomical system.

Original dimensionless midpoint calculation for f(u) = 2 + u² on [0,1]. The exact mathematical integral is 7/3.
Subintervals NWidth hMidpoint estimate INI − IN
20.52.31250.0208333333
40.252.3281250.0052083333
80.1252.332031250.00130208333
160.06252.33300781250.000325520833
04

The continuum calculation can still disagree with a reference

For this known error form, Richardson extrapolation cancels the h² term: (4I2N − IN)/3 = I. Using N = 2 and 4 gives (4 × 2.328125 − 2.3125)/3 = 7/3. This exact cancellation belongs to this quadratic midpoint problem, apart from floating-point roundoff.

Now assign a separate hypothetical reference value R = 73/30 = 7/3 + 0.1. It is an invented comparison value, not a measured observation. For N = 2, R − IN = 0.1208333333; for N = 16, it is approximately 0.100325520833.

As N increases without bound, the numerical estimate approaches 7/3 and the reference gap approaches 0.1. Further removal of this discretization error cannot erase that fixed difference. The computation can become more accurate for its mathematical problem while the comparison remains discrepant.

The gap alone does not diagnose its cause. In real work one would examine physical-model omissions, input values, reference calibration, observing response and uncertainty. This toy supplies no probability model with which to assign significance or decide that the discrepancy is new physics.

05

Convergence is evidence with a stated domain

A refinement study should hold the mathematical problem fixed and inspect the relevant output. If parameters are retuned with every grid or time step, a change in the answer may combine numerical and calibration changes. Keep those histories distinct.

NASA’s grid-convergence tutorial explains the role of an asymptotic error regime in extrapolation. Discontinuities, unresolved scales, incomplete iteration or floating-point effects can defeat a convenient refinement pattern. Smaller steps do not universally improve every computed quantity monotonically.

Rein and Tamayo’s WHFast paper provides a concrete astronomical methods example: numerical gravitational integration depends on coordinate transformations, operator splitting and finite-precision operations. Algebraically equivalent implementations can accumulate different roundoff, and taking more steps can increase that contribution. Its historical benchmark results are not a general recommendation for a present solver or time step.

Conservation checks, exact or limiting-case solutions, independently implemented calculations and refinement studies test different aspects of a simulation. Good energy behaviour alone does not establish every trajectory, phase or omitted physical process. State which quantity, range and tolerance each check addresses.

06

A validated use is narrower than a universal approval

A predictive uncertainty budget can include parameter and input uncertainty, numerical error, reference uncertainty and structural discrepancy between the physical model and the system. These contributions are conceptually different even when they all affect the same output value.

Agreement with uncertain referents in one observing regime supports uses covered by that comparison. Extrapolating to another density, timescale, resolution, source population or instrument response needs a new justification. A complicated model is not exempt from that boundary.

Preserve the equations and assumptions, implementation version, input configuration, numerical checks, calibration data and independent comparisons. This lets a later reader distinguish what was computed accurately from what was tested physically.

The next lesson examines a different limitation of fitting: several candidate functions can agree exactly at the available calibration points while making different predictions elsewhere. Accurate arithmetic at those points cannot choose among explanations that the design never distinguishes.

Worked examples

Predict the next numerical error

If the midpoint error is 1/(12N²), what happens when N increases from four to eight?

  1. At N = 4, the exact error is 1/192 ≈ 0.0052083333.
  2. At N = 8, it is 1/768 ≈ 0.00130208333.
  3. The second is one quarter of the first.

Halving the subinterval width quarters the error for this exact quadratic problem.

Separate numerical accuracy from reference agreement

What gap remains to the hypothetical R = 73/30 after exact Richardson cancellation gives 7/3?

  1. The extrapolated mathematical answer is 7/3 = 70/30.
  2. Subtract it from the independently assigned synthetic reference 73/30.
  3. The difference is 3/30.

0.1. Eliminating the midpoint discretization error does not eliminate this separate reference discrepancy.

Try the reasoning

  1. Does accurate solution of declared equations establish that all necessary physical processes were included?

    Show the answer and reasoning

    No.

    Numerical verification and physical adequacy address different questions.

  2. Why retain parameter changes separately from grid changes?

    Show the answer and reasoning

    Retuning can mix calibration changes with numerical refinement.

    A refinement study should make clear which mathematical problem is being compared.

  3. Does a smaller time step always reduce the total numerical error?

    Show the answer and reasoning

    No.

    More operations can increase roundoff, while other error sources may dominate.

  4. Does the toy’s 0.1 gap prove a real astronomical discrepancy?

    Show the answer and reasoning

    No.

    The referent is invented and has no supplied observational uncertainty or physical diagnostic model.

What to carry forward

  • Distinguish the scientific model, its implementation and a particular computed solution.
  • Use exact and refinement checks to bound numerical error in a declared problem.
  • Physical validation and predictive uncertainty require relevant independent comparisons and an intended-use domain.

References

Teaching resources and research supporting this lesson’s explanations and examples.

  1. NASA-STD-7009B: Standard for Models and Simulations, approved5March2024NASA Office of the Chief EngineerReference guide · PDFstandards.nasa.govRead source
  2. Examining Spatial (Grid) ConvergenceJohn W. Slater; NASA Glenn Research Center, NPARC AllianceReference guidegrc.nasa.govRead source
  3. WHFast: A fast and unbiased implementation of a symplectic Wisdom-Holman integrator for long term gravitational simulationsHanno Rein and Daniel TamayoReference guidearxiv.orgRead source
  4. Data analysis recipes: Fitting a model to dataDavid W. Hogg, Jo Bovy and Dustin LangReference guidearxiv.orgRead source