When a massive star dies it can erupt in a supernova.
For a split second it outshines an entire galaxy.
But exactly what causes them has been a mystery for more than 50 years.
Scientists can't just look inside the star
so the only way to figure out what drives the explosion,
known as a 'core collapse supernova', is to simulate it:
blowing up stars, virtually, inside a computer.
The physics involved in supernova explosions is complex.
And only with modern super computers have physicists been able to model the process
in enough detail to get stars to explode in 3D.
A blast which in reality takes less than half a second
can take a supercomputer six months to simulate.
But recent models suggest that scientists are finally getting close
to understanding just what it is that makes a supernova explode.
The simulations start at the end of a star's life.
Having run low on hydrogen the star starts to contract.
An iron core forms at its centre.
Matter from the core then collapses under gravity
to form a neutron star at its heart:
a ball the size of a city, but which packs in more matter than the Sun.
This is the star's core.
Thousands of times smaller than the star itself,
but still a few hundred kilometres across.
Physicists think the collapsing matter hits the neutron star at the centre
sending a massive shockwave rebounding outwards.
You can see the shockwave here in light blue.
But then the wave meets more falling matter;
it stalls and can't escape the core.
The star doesn't explode.
And that is where simulations used to end.
But today's simulations go much further.
Tiny irregularities in the flow of matter
can quickly amplify into massive oscillations.
These appear as a violent, liquid- like sloshing of matter around the neutron star.
Meanwhile neutrinos, particles produced within the neutron star,
ferociously heat up the surrounding matter
causing it to churn and bubble, like water on a stove.
Eventually the intense heat of neutrinos
combines with the pressure of these violent motions
and drives out the shock wave.
The wave accelerates out the core and explodes into the star.
Though all this takes less than half a second
the wave may take as long as a day to reach the star's surface
and create the spectacular fireworks we see.
Understanding this mechanism will help astronomers
to unpick other important processes in the cosmos,
such as how these violent explosions create new atomic elements,
which are vital for seeding fresh stars and planets.
Though physicists can't yet claim to have a complete picture
their simulations are now good enough to compare with real-life observations.
And if a supernova went off today, modern detectors could measure more than ever before.
Detecting things like neutrinos or gravitational waves,
which both sail through matter unimpeded,
would allow astronomers to see inside the exploding star for the very first time.
But to make sense of any of those data,
astronomers need simulations - and lots of them.
Scientists think that the last supernova that blew up in our galaxy was in around 1870
but they tend to go off about twice a century.
That means modellers need to get their skates on.