Correction appended, February 14

If you like (or don’t like) your curly hair, you can thank (or blame), your genes, your shampoo, your climate and your hairdresser. But the fact is they’re all bit players. The real determinant of whether your hair does what you want it to do at any one moment is physics. And a new paper in the journal Physical Review Letters—which is not typically in the habit of offering haircare tips—explains why.

Physicists have never had very good computer models to represent how a curled strand of a flexible material behaves, which is one of the reasons the characters in computer animated cartoons tend to have straight hair. (Kudos to Pixar for giving it a go in Brave). But there’s more than cartoonery at stake in this particular curling event; industrial manufacturers are affected too. “We think of steel pipes as being nice and straight but usually at some point they’re getting wrapped around something,” said MIT graduate student James Miller, who participated in the study, in a statement accompanying its release. “And at large dimensions, they’re so flexible that it’s like . . . dealing with a limp spaghetti noodle.”

To try to understand that, the investigators came at the problem in a number of ways—experimenting with flexible rubber tubes of different widths and lengths, modeling what they learned in a computer, and throwing in a dash of theory. It’s a combination MIT engineer Pedro Reis, one of the study’s authors, called “the perfect triangle of science.” (Reis, for what it’s worth, takes pleasure in pointing out that he’s bald, which perhaps makes his work especially credible since he has no skin—or, rather, only skin—in the game.)

(MORE: This is Why You Get the Munchies)

The investigators concluded that the biggest variable curly hair has to reckon with is weight. The longer a hair grows, the more of a burden the bottom of the shaft must carry until the strand as a whole topples over. Straight hair lays flat after that, becoming what the investigators call a 2-D hook, since it effectively moves in just two dimensions, front to back or side to side. A hair with an innate curliness to it is only beginning its adventure in multi-directional physics. If your curly hair is relatively short, each strand forms what the researchers call a 3-D local helix—growing up, down, swooping in at angles, doubling back on itself. If the hair extends the length of the head or beyond (Brave, we’re looking at you again), it’s called a 3-D global helix, and its behavior, accordingly, becomes more complex.

OK, none of that—save the fancy physics talk—is especially new. You don’t need terms like local helix and global helix to know that short hair is, um, short, and long is long, and they tangle up in different ways. But a curly hair shaft is defined by more than its shape. It also has its own thickness, stiffness and weight, which is particular to the person. The actual number of hairs per square inch on any individual’s scalp can differ from that of another person too, and that greater or lesser crowding may also play a role

All together, it’s exactly the kind of complex, chaotic system that physicists consider a good challenge and everybody else considers a bad hair day. But when Reis and his colleagues reduced all of those variables to algorithms and fed them into their models, they found that they were able to predict the behavior of any type of strand, from fine hairs to thick hairs to massive industrial pipes, and to change their properties by tweaking those variables.

(MORE: TV’s ‘House’ Helps Solve Real-Life Medical Mystery)

“For me,” said Reis, “the importance of the work is being able to take the intrinsic natural curvature of rods into account for this class of problems, which can dramatically affect their mechanical behavior.”

For him, sure. For anyone else—at least anyone carrying around a headful of perhaps 100,000 of those naturally curly rods—the matter is a little less theoretical. In those cases, give a nod to science, but computer models and algorithms are nothing compared to a good blowout and a little mousse.

(MORE: What Happens When Your Body Loses Half Its Weight)

An earlier version of this story incorrectly identified the graduate student involved in the study as John Miller. His name is James.

Write to Jeffrey Kluger at jeffrey.kluger@time.com.