The ancient Chinese practiced copromancy , the diagnosis of health based on the shape, size and texture of feces. So did the Egyptians, the Greeks and nearly every ancient culture .

Even today, your doctor may ask when you last had a bowel movement and to describe it in exquisite detail.

Sure, it's uncomfortable to talk about. But that's where science comes in, because what we don't like to discuss can still cause harm. Irritable bowel syndrome gastrointestinal infections and other poop-related ailments cost Americans billions of dollars annually

But trying to stem these problems was not our main motivation for trying to figure out some of the physics of defecation. It was something else, much more sinister.

From personal observation, into the lab

When parenthood hits, it hits hard. One of us is a working dad who survived by learning a new set of skills, one of which was fecal analysis. Years of diaper changes and then potty training turned me from a poo-analysis novice to a wizened connoisseur.

My life passes by in a series of images: hard feces pellets like peas to long feces like a smooth snake to a puddle of brown water.

Unlike the ancients, we didn't believe that we could predict the future from children's stool. But we did think it was worth trying to understand where all these shapes come from. Having a laboratory to answer questions about the everyday world is one of the distinct pleasures of being a scientist.

As fluid dynamicists , we joined forces with colorectal surgeon Daniel Chu , and two stalwart undergraduates, Candice Kaminski and Morgan LaMarca, who filmed defecation and hand-picked feces from 34 mammalian species at Zoo Atlanta in order to measure their density and viscosity.

We learned that most elephants and other herbivores create "floaters" while most tigers and other carnivores create "sinkers." Inadvertently, we also ranked feces from most to least smelly, starting with tiger and rhino and going all the way to panda.

The zoo's variety of animals provided us with a range of fecal sizes and shapes that served as independent pieces of evidence to validate our mathematical model of the duration of defecation.

We also placed the feces in a device called a "rheometer," a precision blender that can measure the properties of liquid-like and solid-like materials such as chocolate and shampoo. Our lab shares two rheometers with Georgia Tech physicist Alberto Fernandez-Nieves . We have since categorized the rheometers as the "clean rheometer" and the "David Hu rheometer" -- which has seen its fair share of frog saliva , mucus and feces.

The secret to the speed

What else did we learn? Bigger animals have longer feces. And bigger animals also defecate at higher speed. For instance, an elephant defecates at a speed of six centimeters per second, nearly six times as fast as a dog. The speed of defecation for humans is in between: two centimeters per second.

Join the conversation See the latest news and share your comments with CNN Health on Facebook and Twitter.

Together, this meant that defecation duration is constant across many animal species -- around 12 seconds (plus or minus 7 seconds) -- even though the volume varies greatly. Assuming a bell curve distribution, 66 percent of animals take between 5 and 19 seconds to defecate.

It's a surprisingly small range, given that elephant feces have a volume of 20 liters, nearly a thousand times more than a dog's, at 10 milliliters. How can big animals defecate at such high speed?

The answer, we found, was in the properties of an ultra-thin layer of mucus lining the walls of the large intestine. The mucus layer is as thin as human hair, so thin that we could measure it only by weighing feces as the mucus evaporated. Despite being thin, the mucus is very slippery, more than 100 times less viscous than feces.

During defecation, feces moves like a solid plug. Therefore, in ideal conditions, the combined length and diameter of feces is simply determined by the shape of one's rectum and large intestine. One of the big findings of our study was that feces extend halfway up the length of the colon from the rectum.

A unified theory of pooping

Putting the length of feces together with the properties of mucus, we now have a cohesive physics story for how defecation happens. Bigger animals have longer feces, but also thicker mucus, enabling them to achieve high speeds with the same pressure. Without this mucus layer, defecation might not be possible.

Alterations in mucus can contribute to several ailments, including chronic constipation and even infections by bacteria such as C. difficile in the gastrointestinal tract.

Beyond simply following our scientific curiosity, our measurements of feces have also had some practical applications. Our defecation data helped us design an adult diaper for astronauts. Astronauts want to stay in space suits for seven days, but are limited by their diapers.

Taking advantage of the viscosity of feces, we designed a diaper that segregates the feces away from direct contact with skin. It was a semifinalist in the NASA Space Poop Challenge earlier this year.

It just shows that physics and mathematics can be used everywhere, even in your toilet bowl.