How do we predict the weather?

Have you ever wondered how your weather app works?

Somehow, your phone can predict if the weekend will be sunny or rainy, and a lot of the time, it is right.

The short answer, is we use a computer. By the end of this explainer, you should have an idea of how this is done.

Making a computer predict the weather is a hard problem. A tip I was given for solving hard problems is: if a problem is too hard for you, find an easier one and see if you can solve that first.

So let’s instead try to make a computer predict the motion of a tennis ball.

How do computers predict tennis balls?

You will have met forces in physics. If we can write down all the forces acting on the ball at a particular moment, then, using Newton’s second law, we can determine how those forces will cause the ball to accelerate or decelerate.

For a ball flying through the air, there are only two forces acting on it. Gravity pulls it down towards the Earth, and air resistance pushes against the direction of travel. We are going to call this part, where we put in the forces and get out the acceleration, our governing equation.

To predict where my ball is going, I also have to tell you a few more things. I need to tell you where the ball was, how fast it was going and in what direction. These are called our initial conditions.

Our prediction for where a ball I threw at 100 miles per hour will end up should be very different to our prediction for where a ball I barely threw at all goes. Similarly, we need to know whether I threw the ball in Brazil or France, and whether I threw it straight up or straight into the ground.

Once we have these initial conditions, we can use our governing equations to predict what will happen next.

Acceleration tells us how much the speed and direction of travel of our ball are going to change in a small amount of time. On our computer, we could set this small amount of time to be half a second.

First, we calculate our new speed and direction of travel half a second from now using our governing equation. Then, using this new speed and direction along with our old one, we calculate where our ball will be in half a second. Then we can start again. Calculating a new acceleration and a new position.

In this way, we could predict where the ball will be at any future time. If we stepped forward 7200 times, we would have a prediction for where the ball would be in an hour.

Ok, so how do computers predict the weather?

We are now in a position to make our computer predict the weather. Just like the ball, we need to figure out our governing equations and initial conditions.

Let’s start with the governing equations.

When we apply Newton’s second law to a fluid, we give it a fancy name you can impress and mystify your friends with: the Navier-Stokes equations. But it really boils down to determining the forces on the fluid and thereby calculating its acceleration.

If we imagine a lump of air in the atmosphere, there are only a couple of forces on it that are important. There is how it is being pushed on by neighbouring lumps of air (pressure), how it is being slowed down by the friction of the air around it (viscosity) and how it is being pushed up or down by its weight relative to the air around it (buoyancy).

Things get tricky when we realise we want to write equations not just for this small lump of air, but for a pretty large box full of air. In contemporary forecasts, we are talking 10 km by 10 km by perhaps 100 m in the vertical direction. But the idea is the same as our ball; we are trying to figure out all the things that cause the air in that box to accelerate.

Now what about the initial conditions?

For our ball, the governing equation would be useless if we didn’t know we were throwing it at 12000 meters per second towards the Sun from Cape Canaveral on Earth. Similarly, the intricate governing equation we found for the air would be useless without knowing the atmosphere's initial state.

Gathering the data for the initial state of every prediction is a huge undertaking. Data from satellites, aircraft, weather balloons and ground stations are all processed, compiled, checked against our predictions and assimilated into our computer model.

Since we don’t have sensors everywhere on Earth, we use our previous prediction, along with the measurements we do have, to make the best guess about what is in the unmeasured locations.

We can finally step forward our prediction.

We use our governing equation to determine how the wind velocity will vary everywhere. Then we use this new value, along with our current value, to predict the winds 5 minutes ahead. We do this again and again until we have a prediction for the weather two weeks or more in the future.

Where next?

Now you have an idea of how weather prediction works, what else could you predict or model in a computer?

Can you think of things I left out of the governing equation for the atmosphere?

The richest countries in the world have more weather observations. Can you explain why this affects forecast quality in different parts of the world?

Salah Kouhen
Postdoctoral Researcher
University of Oxford