sciandu
Computer science

Computer science

Simulations

The computer replays reality: weather, traffic and pendulums in fast forward.

What you need first

How does the weather app know whether it will rain tomorrow? Why can a city plan how a new traffic light will change the traffic before it is built? And how do engineers test an aircraft that does not even exist yet? The answer is the same in every case: with a simulation. The computer replays reality, often faster, cheaper and safer than any real experiment.

Model, rules, time steps

Every simulation has three ingredients. First a model: a simplified description of reality, for example a as a point on a string. Second rules: what changes from one moment to the next, such as how pulls on the pendulum. Third many small time steps: the computer applies the rules again and again, for example for every tenth of a second, and builds up a whole process step by step, like the single frames of a movie.

Pendulum
Length100 cm
L = 100 cm: one swing takes T ≈ 2.0 s

The mass of the bob does not change the period, only the length matters.

Try it: change the pendulum and watch how the computer replays the motion time step by time step.

Why simulations are so useful

With a simulation you can safely test what would be too expensive, too slow or too dangerous in real life. Pilots practise emergency landings in a flight simulator without any aircraft crashing. Climate researchers let the next 100 years run on a supercomputer in a few weeks. And in a simulation you can try a hundred variants and simply restart when something goes wrong.

The limits: the model is not reality

A simulation is only ever as good as its model. What the model leaves out, the simulation cannot show: if your pendulum model ignores , the simulated pendulum swings forever, but the real one does not. That is why simulations are compared with real measurements again and again, and why we stay careful: a result from a simulation is a prediction, not a proof.

Exercises

0 of 6 solved

Time to try it yourself. You can't break anything, every attempt counts.

What is a model in a simulation?

A simulation calculates in time steps of 0.5 seconds. How many time steps does it need to replay 10 seconds?

In the simulated pendulum one full swing, meaning over and back again, takes 2 seconds. How many full swings does the simulation show in 30 seconds?

Match each ingredient of a simulation to what it does.

Model
Rules
Time step

Why do pilots prefer to practise emergency landings in a flight simulator instead of a real aircraft?

A result from a simulation is a prediction and not a .

Where this leads