ASTR 474 · Computational Lab 01

Lab 01: Floating-Point and ODE Error Audit

L01-L02 · conditioning and initial-value solvers

Purpose and learning objectives

L01-L02 · conditioning and initial-value solvers. This investigation develops a numerical method and tests its output against a declared benchmark, invariant, uncertainty model, or independent implementation.

Preparation, setup, and inputs

Software: CPython 3.14.6; dependencies in requirements.txt. From repository root run .venv/Scripts/python.exe materials/ASTR474/src/astr474_computations.py. Then use the corresponding CSV/JSON under materials/ASTR474/data/generated/. Required data: computed_results.json and generated SciPy decay runs.

Apparatus: computer with local CPU, terminal, text editor, and browser; no telescope, GPU, network account, or paid service is required. Preserve the generated input files and record file hash/version.

Model scope: The decay IVP and cancellation arithmetic are controlled synthetic benchmarks with analytic reference values.

Procedure

  1. Create the pinned environment from requirements.txt and record Python plus NumPy/SciPy versions.
  2. Run the computation module and inspect floating-point spacing around 1; reproduce the cancellation calculation in float64 and extended precision if available.
  3. For y'=-y, y(0)=1 on [0,1], record RK45 output at rtol 1e-3, 1e-6, 1e-9, and 1e-12; compare y(1) with exp(-1).
  4. Plot absolute global error against tolerance and solver steps; repeat with a second method and fixed output grid.
  5. Use Astropy Quantity for one length/time conversion and show that an intentionally inconsistent unit cannot be silently combined.

Measurement record

QuantityValue or fieldUnit/conventionSource/method
Input configurationRecord solver, version, seed, timestep/grid/toleranceAs defined by the experimentCommand line and source file
Primary diagnosticRecord every resolution/sample/fit row, not just the preferred resultState units and normalizationGenerated CSV/JSON
Independent referenceAt rtol=1e-03, endpoint error is 0.0002106; at rtol=1e-12, it is 7.577e-14. The analytic endpoint is 0.36787944.As stated in the generated exampleAnalytic/JPL/invariant cross-check
Uncertainty/sensitivityRepeat with changed resolution, seed, parameter, or methodReport interval or relative changeStudent analysis

Analysis and uncertainty

Use tolerance sweep as a numerical sensitivity study, not as a statistical confidence interval; identify roundoff plateau and solver-dependent behavior.

Plot the diagnostic against the controlled parameter; label axes, units, normalization, and reference. Explain any non-monotonic point rather than smoothing or dropping it. If propagating independent errors, state why independence is plausible; preserve correlated/common-mode terms separately.

Deliverables and assessment

  1. Runnable source or notebook export with command, package versions, and all input/output paths.
  2. One scientific figure plus a machine-readable table of measurements and convergence/sampling/residual diagnostics.
  3. A 700-1000 word technical report describing model, method, validation, uncertainty categories, and one failed assumption.
  4. A short claim-evidence table separating result, numerical check, and domain limitation.

Rubric: 30% correct method and setup; 25% validation and numerical diagnostics; 20% uncertainty/provenance; 15% physical interpretation; 10% clarity and reproducibility. Revisions and resubmissions are encouraged under the syllabus mastery policy.

Data and source provenance

The decay IVP and cancellation arithmetic are controlled synthetic benchmarks with analytic reference values. Provenance levels, request records, and source verification limits are documented in reference-log.md; generated files and seeds are documented in data/README.md.

References: