The tendency for shoelaces to almost magically come undone is a frustration that's familiar to all of us, but researchers now think they've worked out the science behind this mystery: and it's all to do with stomping and whipping.

In fact the new study on shoelace unravelling says the forces acting on a tied shoelace can be greater than those felt by humans on the most extreme rollercoaster – so it's no wonder they tend to slip apart.

To get to the bottom of the mystery of the loose shoelaces, researchers from the University of California, Berkeley, studied both a human runner on a treadmill and a mechanical leg programmed to swing and stomp as our own legs might do.

They found that a combination of forces on the free ends of the shoelaces gradually undo the tight knot at the centre – even if you've taken great care over it – and once this untangling starts there's no stopping it.

"It's unpredictable but when it happens, it's in two or three strides and it's catastrophic," one of the researcher team, Oliver O'Reilly, told Hannah Devlin at the Guardian. "There's no way of coming back from it."

When we take a jog around the block or sprint for the bus, our feet can strike the ground with up to seven times the force of gravity, the researchers found from their observations.

That causes the free ends of our shoelaces to flap around – but what's actually happening is the laces are stretching and then relaxing as we run or walk briskly.

As the leg swings back up, the laces are caught by an inertial force working against this movement, tugging further at the ends of the threads.

Both the foot hitting the floor and the swinging cause the knot to loosen, and before you know it, you're trying not to trip over your own feet.

In other words the forces of gravity and movement are pulling on the ends of the shoelaces just as our hands might do.

Stomping shoes while stationary or swinging a leg from a chair didn't have the same effect, the researchers found, so it's the running (or the walking), and the particular combination of forces that seem to be key.

The study even looked at the differences between the granny knot and the stronger square knot, finding that the square knot only failed half the time during tests, whereas the granny knot always failed.

Based on the data it seems a square knot is more resistant to the force of our feet hitting the ground – but the team still isn't sure exactly why that's the case.

The researchers say we can learn much more from the study besides how often we might have to retie our shoelaces: it could deepen our understanding of all kinds of important knots, from quantum mechanics to DNA.

"When you talk about knotted structures, if you can start to understand the shoelace, then you can apply it to other things, like DNA or microstructures, that fail under dynamic forces," says another of the researchers, Christopher Daily-Diamond.

"This is the first step toward understanding why certain knots are better than others, which no one has really done."

The research has been published in Proceedings of the Royal Society A.

You can see one of the videos shot by the researchers below: