Parties with bouncy castles are parties kids want to attend, but those air-filled playhouses have an unfortunate habit of taking flight. An empty one flew into power lines last week, and people are regularly hurt or even killed when castles become projectiles.

One reason this happens is poor and uneven regulation. Another is fluid mechanics.

Manufacturers advise against keeping a bouncy castle inflated if wind is above 20 or 25 mph, and it’s not hard to see why. When a fluid—a category that includes gases and liquids—flows into something, the force it exerts is equal to half of its density multiplied by the area it’s pushing against and the square of its speed:

We already have the speed to use: 25 mph, or about 37 feet per second. The density of air is 0.04 kilograms per cubic foot. (I’ll use kilograms for masses and pounds for forces and weights to avoid confusion.) That leaves the area the wind hits: a bouncy castle wall. Quick research suggests that an average bouncy castle is something like a cube with 15-foot sides, which makes the area of one wall 15 x 15 = 225 square feet. Inputting all those numbers gives just over 380 pounds of force pushing on one wall.

Now, these funhouses weigh an average of about 250 pounds, but the wind is only fighting the force of friction, which is much less than that:

The friction equation has only two variables. There’s W, which is the weight of the object (in this case, the bouncy castle), and there’s mu, which is the coefficient of friction. Mu depends on both the object and what it’s sitting on, and it tells you how much of the weight gets used to resist movement. No one has calculated mu between a bouncy castle and grass, but it’s probably about 0.3, which is a fairly typical value across many different pairs of materials.

Using a weight of 250 pounds, the force of friction is just 75 pounds. Any force larger than 75 pounds—20 percent the force of the wind—could push the bouncy castle around. This is why hammering down the stakes that come with the bouncy castle is crucial: They absorb the extra load and keep the castle stationary.

So unsecured castles will tumble. But why do some take flight? Bouncy castles are, well, bouncy. As soon as they hit any sort of hump, they bound a bit into the air—and once they’re up, strong gusts can keep them there. Alternatively, they can start to tip, letting the wind get underneath to push from all sides. But there’s another way, too.

Flowing fluids might exert pressure when they hit something, but they have lower pressure perpendicular to the direction they’re flowing than stationary fluids do. This is how planes and bouncy castles alike can take flight. The wind flowing over the bouncy castle has a lower pressure than the air inside—assuming the wind doesn’t get into the bouncy castle, of course. The difference means that there’s pressure against the roof, and that pressure is given by Bernoulli’s equation (ignoring things like tiny height differences):

The air inside isn’t moving, so its velocity is zero, giving us a different form of an equation that we’ve seen before. Force is pressure multiplied by area, and the area of the top of a cube is the same as the area of one of its sides. That means that the force pushing the castle up is:

That’s the equation we started with, which gave us a force of 380 pounds—only this time, it’s upward instead of sideways. That’s enough to make any untethered bouncy castle take flight.