In February, astronomers announced the discovery of a nearby star with seven Earth-size planets, and at least some of the planets seemed to be in a zone that could provide cozy conditions for life.

The finding of these planets circling the star Trappist-1 40 light-years away came with a bit of mystery. The orbits of the planets are packed tightly, and computer calculations by the discoverers suggested that the gravitational jostling would send the planets colliding with each other or flying apart, some to deep space, others spiraling into the star and destruction.

Now new research provides an explanation for the dynamics of how this planetary system could have formed and remained in stable harmony over billions of years.

"It's actually a very special system," said Daniel Tamayo, a postdoctoral researcher at the University of Toronto Scarborough and the lead author of a paper appearing in Astrophysical Journal Letters.

While the planets are roughly the size of Earth, the Trappist-1 system is very different from our solar system. Trappist-1 is a dwarf star that is much smaller and colder than our sun, and all seven of the planets orbit within six million miles of the star. By contrast, Mercury, the innermost planet of our solar system, is 36 million miles from our sun. Earth is nearly 93 million miles away.

Since the Trappist-1 planets are so close to their star, they orbit quickly, taking between 1.5 days and 19 days to complete one orbit.

The original discoverers noted that those orbits were almost exactly in what scientists call "resonance." That is, the second planet completes five orbits in almost exactly the time the first planet makes eight. The third planet completes three orbits for every five orbits of the second planet, and the fourth planet makes two orbits for every three orbits of the third. The other planets are also in resonance.

Yet when they plugged the data into computer simulations, the orbits quickly became unstable, falling apart in less than a million years. Even when they added the effects of tides on the planets, which tend to push planets toward more circular, stable orbits, the system still often fell apart within a few million years, a cosmic instant.

Tamayo and his colleagues looked at possible ways that the planets got to where they are now. The planets formed out of a disk of gas and dust. After that formation, the remaining disk would have nudged the planets inward, and those nudges tend to push the planets toward the stable resonances.

Tamayo offered the analogy of musicians in an orchestra. "It's not enough for members to merely keep time," he said.

The missing information about orbits is like musicians playing out of tune, he said. "By contrast," Tamayo said, "simulating the formation of the system in its birth disk is analogous to the orchestra tuning itself before playing. When we create these harmonized systems, we find that the majority survive for as long as we can run our supercomputer simulations."

In more than 300 computer runs, each simulating five million years, the vast majority stayed stable, Tamayo said.

Then they ran 21 simulations each tracing about 50 million years of orbits, and 17 of those were stable. That suggests the orbits are stable for several billion years, although it does not provide definitive proof.