Four planets locked in a rhythm around a nearby star are destined to be sent pinballing around their solar system when their sun eventually dies, a new study suggests.

Astronomers modelled how the change in gravitational forces in the system as a result of the star becoming a white dwarf will cause its planets to fly loose from their orbits and bounce off each other’s gravity.

This is similar to balls bouncing off a bumper in a game of pinball.

During this process the planets will knock nearby debris into their dying sun, offering scientists new insight into how white dwarfs with polluted atmospheres originally evolved.

The HR 8799 system is 135 light years away and is made up of a 30-40 million-year-old A type star and four unusually massive planets.

The planets are more than five times the mass of Jupiter, orbiting very close to each other.

The system also contains two debris discs, inside the orbit of the innermost planet and another outside the outermost.

According to researchers, the four planets are locked in a perfect rhythm that sees each one completing double the orbit of its neighbour.

For every orbit the furthest planet completes, the next closest completes two, the next completes four, while the closest completes eight.

The team from the universities of Warwick and Exeter investigated what may cause the perfect rhythm to destabilise in the future.

The resonance that locks the four planets is likely to remain in place for the next three billion years, despite the effects of Galactic tides and close flybys of other stars, the researchers determined.

However, it always breaks once the star enters the phase in which it becomes a red giant.

This is when it will expand to several hundred times its current size and eject nearly half its mass, finishing as a white dwarf.

Then the planets will start to pinball and become a highly chaotic system where their movements become very uncertain.

Changing a planet’s position by even one centimetre at the start of the process can dramatically change the outcome, researchers say.

Lead author, Dr Dimitri Veras, from the University of Warwick department of physics, said: “The planets will gravitationally scatter off of one another.

“In one case, the innermost planet could be ejected from the system. Or, in another case, the third planet may be ejected.

“Or the second and fourth planets could switch positions. Any combination is possible just with little tweaks.

“They are so big and so close to each other the only thing that’s keeping them in this perfect rhythm right now is the location of their orbits.

“All four are connected in this chain. As soon as the star loses mass, their locations will deviate, then two of them will scatter off one another, causing a chain reaction amongst all four.”

Dr Veras was supported by an Ernest Rutherford Fellowship from the Science and Technology Facilities Council, part of UK Research and Innovation.

The team is certain the planets will move around enough to dislodge material from the system’s debris discs into the atmosphere of the star, regardless of the exact movements of the planets

Astronomers are analysing this type of debris today to discover the histories of other white dwarf systems.

Dr Veras added: “These planets move around the white dwarf at different locations and can easily kick whatever debris is still there into the white dwarf, polluting it.

“The HR 8799 planetary system represents a foretaste of the polluted white dwarf systems that we see today. It’s a demonstration of the value of computing the fates of planetary systems, rather than just looking at their formation.”

Co-author, Professor Sasha Hinkley, of the University of Exeter, said: “The HR 8799 system has been so iconic for exoplanetary science since its discovery nearly 13 years ago, and so it is fascinating to see into the future, and watch it evolve from a harmonious collection of planets into a chaotic scene.”

The research is published in the Monthly Notices of the Royal Astronomical Society.