Before there were planets, before there was carbon in your bones or oxygen in your lungs, there was only darkness and gas. Then, somewhere in the infant Universe, the first stars switched on.

Now a team in the UK is recreating that moment inside a computer. Researchers at the University of Bath are leading MEGATRON, a project of extraordinarily detailed simulations that show how those earliest stars lit up a previously dark Universe and began producing elements such as carbon, oxygen and iron, according to a University of Bath release.

A universe in miniature

In plain terms, MEGATRON is a virtual cosmos built to follow the birth of the first galaxies. The simulations begin with pristine gas containing no heavy elements, reproducing conditions that existed shortly after the Big Bang.

From there, the models follow the formation of the first stars, the radiation those stars release, and the supernova explosions that end their lives. They also track how newly created elements spread into later generations of stars and galaxies.

The simulations follow a young galaxy as it grows towards a system roughly comparable in mass to our own Milky Way. At the same time, they track how gas moves, how starlight travels through space and how the concentrations of different chemical elements change over billions of years.

The project is led by the University of Bath, with collaborators at the University of Chicago in the US and the Institut d'Astrophysique de Paris in France.

Two clues, one story

The big idea is to connect two very different records of the early Universe. One comes from the James Webb Space Telescope (JWST), which lets astronomers directly observe galaxies from the Universe's infancy.

The other comes from some of the oldest stars in and around the Milky Way. Their chemical fingerprints act as a fossil record of events billions of years ago, allowing scientists to infer what the first stars were like and how they began enriching the cosmos.

"The James Webb Space Telescope gives us a direct glimpse of the infant cosmos, while stellar archaeology allows us to study the relics of those earliest times in our own Galactic neighborhood. MEGATRON provides a physical bridge between the two," said Dr Martin Rey of the University of Bath's Department of Physics, a lead contributor to the collaboration.

Why the detail matters

The team's findings suggest that researchers need to model the complicated interactions between starlight, gas and newly created elements accurately if they want to link those two records.

The results also indicate that less detailed models may underestimate how strongly stellar radiation and complex chemical processes affect the gas around galaxies. By simulating at exceptionally high resolution, the researchers captured structures in the gas that simpler approaches can miss. That could help astronomers make more accurate predictions for observations being gathered now and in the future.

Four studies, and a big boost

Four MEGATRON studies have been published in the Open Journal of Astrophysics. The university describes them as the collaboration's first major collection of published results, with more expected.

One of them, with Dr Rey as first author alongside a long list of co-authors, is titled "MEGATRON: how the first stars can create an iron metallicity plateau in the smallest dwarf galaxies".

The project has also received 40 million processor hours on the UK's national supercomputers. The university says that is equivalent to running five million laptops at the same time for an entire year.

The extra computing power will let the team build simulations with even greater resolution and more complete physical models, and make increasingly direct comparisons with JWST observations and the chemical fossil record in ancient stars.

"MEGATRON provides a common physical framework for interpreting two of astronomy's most exciting new datasets: JWST's view of the earliest galaxies and the stellar fossil record," said Dr Rey. "Together, these complementary observations allow us to test competing models of the first stars in ways that weren't previously possible."

Where we come from

For Dr Rey, the work comes back to one of astronomy's most fundamental questions. "The elements that make our world and life possible - carbon, oxygen, iron and many others - were forged by stars," he said. "To understand where those elements came from, we need to understand how the first stars formed and enriched their surroundings."

MEGATRON began in 2023 and is scheduled to continue through 2030. With JWST still revealing some of the earliest known galaxies, and large stellar surveys measuring ancient stars in ever finer detail, the team is hoping for a much clearer picture of the first generations of stars.

It is a rather lovely thought: the story of how the first stars lit up the dark is being pieced together, in part, by a team in Bath.