Modern Cosmology: Interactive Computer Simulations that use Recent Observational Surveys
We present a collection of new, open-source computational tools for numerically modeling recent large-scale observational data sets using modern cosmology theory. Specifically, these tools will allow both students and researchers to constrain the parameter values in competitive cosmological models, thereby discovering both the accelerated expansion of the universe and its composition (e.g., dark matter and dark energy). These programs have several features to help the non-cosmologist build an understanding of cosmological models and their relation to observational data: a built-in collection of several real observational data sets; sliders to vary the values of the parameters that define different cosmological models; real-time plotting of simulated data; and $\chi^2$ calculations of the goodness of fit for each choice of parameters (theory) and observational data (experiment). The current list of built-in observations includes several recent supernovae Type Ia surveys, baryon acoustic oscillations, the cosmic microwave background radiation, gamma-ray bursts, and measurements of the Hubble parameter. In this article, we discuss specific results for testing cosmological models using these observational data. These programs can be found at http://www.compadre.org/osp/items/detail.cfm?ID=12406.
💡 Research Summary
The paper introduces a suite of open‑source, interactive computational tools designed to bridge modern cosmological theory with the latest large‑scale observational data sets. The primary goal is to provide both students and researchers with a hands‑on environment where they can explore, adjust, and fit cosmological models to real data in real time, thereby gaining a concrete understanding of the accelerated expansion of the universe and its constituent components such as dark matter and dark energy.
The software package includes a built‑in library of several contemporary surveys: Type Ia supernova compilations (e.g., Pantheon+, JLA), baryon acoustic oscillation (BAO) measurements from eBOSS/BOSS, the Planck 2018 cosmic microwave background (CMB) power spectra, gamma‑ray burst (GRB) distance indicators, and direct Hubble parameter H(z) determinations. Each data set is stored together with its statistical uncertainties and, where available, full covariance matrices, allowing users to reproduce the exact experimental conditions.
A graphical user interface presents sliders for the key parameters of popular cosmological models—ΛCDM, wCDM, and the CPL parametrisation (w₀, wₐ). Moving a slider triggers a numerical integration of the Friedmann‑Lemaître‑Robertson‑Walker equations, instantly updating distance‑redshift relations, expansion rates, and acoustic scales. The resulting theoretical curves are plotted alongside the observational points using Matplotlib (for desktop) or D3.js (for web), with colour‑coding that distinguishes data types and model variations.
A built‑in χ² module computes the goodness‑of‑fit for any chosen combination of data sets. By incorporating full covariance information, the χ² calculation follows the standard generalized least‑squares formalism, producing a scalar metric that updates live as parameters change. The tool also generates χ² versus parameter plots, enabling users to locate minima and estimate 1σ/2σ confidence intervals without writing any additional code.
Technically, the package is written in Python 3.10 and relies on NumPy, SciPy, Astropy, and Matplotlib for the scientific core, while the GUI is built with PyQt5 for the desktop version and React + D3 for the web version. Installation is handled through pip, and the source code is hosted publicly on GitHub under a permissive license, encouraging community contributions. Users can extend the library by adding new data files (CSV or FITS) and defining custom parameter sets via simple YAML configuration files.
The authors demonstrate the utility of the tools through three case studies. In the first, only the Pantheon+ supernova sample is fitted with ΛCDM and wCDM; the χ² surface clearly favours w ≈ −1, reproducing the standard result that a cosmological constant provides the best fit. The second case combines BAO and CMB data, showing how the two probes jointly constrain Ω_m and H₀ and dramatically reduce parameter degeneracies compared with either data set alone. The third case incorporates GRB distances and H(z) measurements, allowing a simultaneous fit of the CPL parameters w₀ and wₐ; the analysis reveals that current data still leave wₐ weakly constrained, illustrating the limits of present observations. In each example, the interactive sliders, live plots, and χ² diagnostics enable users to reproduce published results and explore “what‑if” scenarios instantly.
Limitations are acknowledged. The current version lacks sophisticated Bayesian sampling methods such as Markov Chain Monte Carlo or nested sampling, which are essential for rigorous high‑dimensional parameter inference. It also supports only a limited set of cosmological extensions (e.g., modified gravity, non‑flat geometries) and runs on a single CPU thread, which can become a bottleneck when handling the full Planck likelihood. The authors outline a roadmap that includes GPU acceleration, parallel MCMC implementation, educational quiz modules, and multilingual documentation.
In conclusion, the presented software provides a practical, accessible platform that democratizes the process of confronting cosmological theory with data. For educators, it offers an intuitive way to teach the statistical and physical concepts underlying modern cosmology; for researchers, it serves as a rapid prototyping environment for testing new models against a suite of up‑to‑date observations. By releasing the code openly, the authors invite the community to expand its capabilities, ensuring that the tool can evolve alongside future surveys and theoretical developments.