# Computer models

by Chris Woodford. Last updated: October 2, 2017.

Is it going to rain tomorrow? How will climate change affect world food production? Is there likely be another stock-market crash? Where will a hurricane do the most damage? These are the sorts of questions you can answer with a computer model—a mathematical way of predicting the future based on what's happened in the past. Computer models have been widely used since the mid-20th century. That's when the first, powerful scientific computers made it possible to study complex problems such as weather forecasting (without looking out of the window) and how atom bombs work (without setting off dangerous explosions). So what exactly is a computer model? Let's take a closer look!

Photo: Computer models are useful for studying things we can't easily visualize in any other way. This is a computer graphic model of the fluid flow and temperature inside a teapot. Photo by courtesy of Pacific Northwest National Laboratory and US Department of Energy.

## What is a model?

Have you noticed how children love playing with models? From dolls houses and cuddly dogs to model airplanes and race cars, many of the toys children like most are actually simplified versions of things we find in the world around us. Are kids wasting their time playing with toys like this? Far from it! Monkeying around with a model helps you learn how the world works. Build a model suspension bridge and—whether you realize it or not—you're learning an awful lot about the science of forces and the practicalities of everyday engineering. In theory, you can test whether a new bridge design would work by building a model with an erector set and loading it up with toy cars. That's why NASA scientists build models of rockets and space planes and test them out in wind tunnels. Realistic models of real-world things are called physical models. They're concrete and realistic and you can tell straight away what they're supposed to be.

Photo: A physical model. This is a little wooden model of a real-life sailboat, but you can see that it's hugely simplified. In theory, you could put it in the bathtub and use it to study how sailboats work by blowing on it (using your breath to model the wind). But if you try to do that, you'll find it capsizes straight away. That's because the sails aren't hung realistically and, unlike on a real boat, there is no keel (underwater stabilizing bar) to keep the vessel upright. A model like this is too crudely simplified to use for scientific studies of real boats—but it looks neat on my bookshelf!

### How is a mathematical model different?

There are lots of things we need to understand that we can't build out of miniature plastic parts. You can't make a model of the weather that way or predict whether a disease epidemic will spread more in a hot summer or a cold winter. Things like this have to be modeled mathematically. A mathematical model is an abstract way of understanding very complex things like the weather or the world economic system. It's a collection of algebraic equations (things like a+b=2c÷d×e) that relate different quantities called variables (represented here by the letters a, b, c, d, and e). In the case of weather forecasting, the variables are things like air pressure, air temperature, humidity, ocean temperature, wind speed, and so on and they're related by equations based on the laws of physics. In theory, if you've measured some of these things, you can figure out the others by solving the equations; and if you've measured the things many times in the past and know how they relate to one another, you can attempt to predict what will happen in the future. That's mathematical modeling in a nutshell! Unlike with a physical model, a mathematical model doesn't necessarily bear any physical resemblance to the thing it represents; a mathematical model of the weather won't give you a suntan or soak you to the skin. But there are ways of representing mathematical models visually. A graph, for example, might be a visual representation of a mathematical model.

### Why use a computer for mathematical modeling?

Photo: Computer modeling a wind tunnel test: Building realistic models of new cars to test their aerodynamics is expensive and time consuming, so a lot of this kind of work is now done with computer models. You can even try your hand at it yourself by downloading a wind tunnel modeling app for your smartphone, like this one. It's a great educational exercise for physics students.

You don't necessarily need a computer to make a mathematical model. Pick an easy enough problem and you can do the math in your head or draw yourself a little chart on paper. Let's look at a really simple example. Suppose you're 10 years old and you want to know how tall you're going to be when you're 20. You could guess you're going to be twice as tall (because you'll be twice as old), but if you've done a lot of growing early on and you're tall for your age, that's going to give you the wrong answer. If you've grown at a steady rate (so many centimeters/inches per year), you could guess that your height at some age in the future (let's call it X) is your height at age 10 (call that A) plus the number of years into the future (call that B) times the number of centimeters you grow per year (call that C). So X = A + (B × C). If you're 150cm (1.5m or ˜5 ft) tall at age 10 and grow an average of 5cm (˜ 2 inches) per year for each of the next 10 years, you'll be 150 + (10 x 5) = 200cm (6.5 ft) tall at age 20. That sounds like a fair guess (if a little on the high side)—and it certainly sounds better than just doubling your height at age 10 (which predicts a height of 3m or 10ft by age 20).

A model of something like the weather involves hundreds, thousands, or even millions of different variables linked together by much more complex equations. There are so many variables and so many equations that it would take forever to solve them by hand. When pioneering mathematical modeler Lewis Fry Richardson made one of the world's first detailed weather forecasts this way in the 1920s, using just seven equations, it took him and his wife something like six weeks to figure out a single day's weather! That's why, in practice, supercomputers (ultra-powerful computers) are now used for virtually all mathematical modeling—and why it's now called computer modeling as a result. Let's face it, no-one wants to wait six weeks to hear what the weather was like a couple of months ago!

## How do you build a computer model?

The first step in building a model is to decide which variables it should include and figure out the equations that connect them together. This involves making a number of assumptions and simplifications. Going back to our model of height at age 20, you can see we made two notable assumptions: first, that we'd keep growing at all and second that we'd do so at a steady rate between 10 and 20. What if we'd stopped growing at 11 or grown much more rapidly at ages 14 and 15? We could have allowed for that with a more complex equation if we'd wanted to. Another thing we didn't consider was whether our model ceased to be valid at all after a certain age (do the numbers and you'll find it predicts we'll be 3.5m or ˜11.5 ft tall at the age of 50 and 6m or ˜20ft tall if we reach 100). There were all kinds of things we might have considered or incorporated into our height model—but we glossed over them to keep the problem simple to understand and easy to solve.

Models are always (by definition) simplified versions of real life and, where mathematical models are concerned, there are good reasons for this. If really complex problems (such as weather forecasting and climate change) are being studied, mathematical models have to be simplified purely so that computers can generate useful results in a reasonable amount of time. The science of modeling is all about ensuring that the variables and equations in a model represent reality as accurately as possible, but there's an art to modeling too—and that involves deciding what kind of simplifications can safely be made without making the model so crude that any results it produces are inaccurate or misleading. Early 1970s models of the climate neglected clouds, for example, which were considered too complex and changeable to represent accurately. Once computers became more powerful, climate models were extended to include the way clouds behave, hopefully producing much more accurate and useful weather forecasts and climate simulations in the process.

Photo: Climate models are based on millions of precise measurements of the weather made all over the world during the last few decades. My computer produced this computer model of the climate as part of Climateprediction.net, in which ordinary computer users help scientists study global warming. Over 47,000 computers in the world are helping to "number crunch" climate data for the project.

Once the model is built, it has to be loaded up with data; in the case of a climate model, that means real-world measurements of the different variables, such as temperature, rainfall, and pressure measurements from around the world going back years or decades. Once that's done, it's possible to verify and validate the model. Verifying a model means running it to see whether it makes reasonable predictions. So if you build a model for weather forecasting and it tells you the temperature in Beijing next week is going to be 5000 degrees, you know you've gone wrong somewhere. Validating a model is a different process that involves running a model to produce results you can check against existing data. So if you build a model of the world's weather using measurements taken during every year of the 20th century (from 1900 to 1999), you might run it forward to the years 2002, 2003, and 2004 (say) to see what predictions it makes. You could compare those predictions with actual measurements made during those years and, if there's good agreement, take that as a validation of the model.

With the model successfully built, verified, and validated, the next step is to use it to make some actual predictions. A weather forecasting model could be used to predict how much rain will fall in Toronto or Berlin for a week or two in advance; a climate model (similar in many ways and based on the same data) would be making far less detailed predictions much further into the future.

## What else are computer models used for?

Modeling the weather and climate aren't the only things you can do with computer modeling. Models are used in all kinds of fields from science and engineering to medicine and economics. A model of a newly designed airplane might be used to predict the stresses and strains on different parts of the fuselage at different flying speeds or under different flying conditions (in strong winds, with ice on the wings, or whatever the conditions might be). Military planners often run computer simulations ("wargames") to consider how potential battles might play out with different numbers of tanks, troops, and airplanes. Traffic planners can make models of the highway network (or the streets in a busy city) to test whether new signals or road layouts will make cars run more smoothly. When dramatic accidents occur in space, scientists run models to test the best ways of making repairs or to figure out whether astronauts can return home safely. In all these cases, the modelers can try out many different possibilities and find what works best—without ever leaving their desk!

## Why use computer models?

This illustrates perhaps the most important advantage of computer modeling: it gives us the ability to ask "what if?" questions about complex aspects of the world we can't easily test in reality. You can't build 100 different designs of skyscraper to see which is most likely to survive an earthquake, but you can do that very easily with a computer model. You can't run a war in four different ways to see which option gives the fewest civilian casualties, but a computer model can give you a pretty good idea. If the problem you're trying to tackle is something like climate change, and you want to know what will happen centuries into the future, computer models are the only tools at your disposal.

Photo: Computer models make difficult and dangerous things easy to study safely. This is a model of the fluid flow inside a nuclear reactor. Photo courtesy of Argonne National Laboratory published on Flickr in 2009 under a Creative Commons Licence.

Modeling also saves time and money. Auto manufacturers routinely test the safety of their cars by wrecking prototypes (test versions) with crash-test dummies inside them, but it saves a great deal of time and money to do a lot of pre-testing with computer models beforehand. Computer models make it possible to run many more tests and cars are safer as a result. Computer models are increasingly being used to predict natural disasters, such as hurricanes, earthquakes, and tsunamis. If weather forecasters can accurately predict which tropical storms will become hurricanes, and how they will behave when they hit land, they can warn people of danger in good time, helping to reduce damage to property and potentially save lives.

Next time you fool around with a model, bear this in mind: you're not playing, your carrying out serious scientific research!

## Who invented computer models?

Here's a brief list of some key moments in modeling:

- 1920s: Lewis Fry Richardson begins modeling weather using seven mathematical equations, but has no computers to help him .
- 1940s: US mathematician John von Neumann pioneers the use of computers in modeling
- 1950: An early supercomputer called ENIAC makes the world's first computerized weather forecast.
- 1960: The National Center for Atmospheric Research (NCAR) is established in Boulder, Colorado to study weather and climate with complex computer models.
- 1972: Meteorologist Edwin Lorenz sums up the complex, uncertain, nature of weather forecasting by asking his famous question "Does the flap of a butterfly's wings in Brazil set off a Tornado in Texas?". Attempts to answer the question lead to popular interest in a new branch of math known as chaos theory.
- 1972: A group of academics and others known as The Club of Rome runs a computer model of how the planet's resources are being used and concludes human civilization will collapse.
- 1980s: Spreadsheets (computer programs that calculate and draw charts from lists of numbers entered into tables) are developed for inexpensive PCs, so virtually anyone can build and run simple computer models. Spreadsheets soon revolutionize business planning.
- 1990s: The Internet makes it possible for millions of ordinary PC users to help scientists run large, complex computer models by downloading chunks of data and processing them during "downtime." SETI@Home and FightAIDS@Home are two of the best known projects of this kind.
- 2003: Climate scientists launch Climateprediction.net, allowing millions of computer users worldwide to help run a giant model of the climate.
- 2016: Police in Chicago reveal that they are using a computer model to predict people at most risk of committing (or falling victim to) gun crime.