What are models and simulations?
A model is a simple copy of a real thing that keeps only the parts that matter for our question. A map is a model of a city. A spreadsheet that works out pocket money is a model of your savings.
A computer simulation is a program that runs a model through time, step by step, to see what would happen. The model is the recipe; the simulation is cooking it.
Why simplify?
The real world has too many details. If we kept every detail the program would be too slow and we could not understand it. So we make assumptions, for example "every child meets only 4 neighbours". Good assumptions keep what matters and drop the rest.
Building a simulation: variables, rules and parameters
- Variables (state): what we track, e.g. which children are sick, how many cars are on a road, the temperature in each grid box.
- Rules: how the state changes in one step, e.g. "a sick child infects each neighbour with chance p". Often written as formulas or if-statements.
- Parameters: fixed numbers we choose before a run, e.g. p = 20%, number of days, speed limit. Changing them answers "what if?" questions.
- Time step: how much time one loop stands for (1 day, 1 second). Smaller steps are more accurate but slower.
A simulation is basically a loop:
set start state → repeat: apply rules, time = time + step, record results → show graph
Randomness
Many real events depend on chance. A simulation uses random numbers for them. Each run gives a different answer, so we do many runs and look at the average and the spread. This is called a Monte Carlo simulation.
Examples of simulations
- Weather and climate: the air is split into 3D grid boxes; physics rules move heat, wind and water between boxes each few minutes of model time.
- Traffic: each car follows rules (keep a safe gap, slow down at red). Planners test new signals or lanes before spending money.
- Disease spread: like our classroom model, used to plan vaccines and hospital beds.
- Flight and driving simulators: practise emergencies safely.
- Science and engineering: crash tests of cars, bridges in wind, falling objects with air resistance, population of predators and prey.
- Games: game physics is a simulation of motion.
Checking a simulation, advantages and limits
Validation: compare the simulation's output with real measurements. If they disagree, change the rules or parameters and test again. Verification: check the program does what the model says (no bugs).
Advantages
- Safe: test dangerous things (crashes, epidemics) without harm.
- Cheap and fast: no need to build the real thing; years can run in seconds.
- Repeatable: change one parameter at a time and compare.
- Lets us see things we cannot watch, e.g. inside a star or far in the future.
Limits
- Only as good as the model: wrong assumptions give wrong answers ("garbage in, garbage out").
- Detailed models need powerful computers and lots of data.
- Results are predictions with uncertainty, not facts.
Key formulas and definitions
- Model = simplified copy of a real system
- Simulation = model run step by step through time
- Variable: the state that changes
- Rule: how the state changes each step
- Parameter: number you set before a run
- Monte Carlo: many random runs → average
- Validation: compare output with real data
Worked examples
1. A pond has 100 fish. Each year the number grows by 10%, then 5 fish are caught. Simulate 2 years.
Year 1: 100 × 1.10 = 110, minus 5 = 105. Year 2: 105 × 1.10 = 115.5, minus 5 = 110.5 ≈ 110 fish. Variable: fish count. Rule: × 1.10 then − 5. Parameters: 10% growth, 5 caught, time step 1 year.
2. A traffic simulation is run 5 times with random arrivals. Queue lengths at the end: 8, 12, 10, 9, 11 cars. What should the report say?
Average = (8 + 12 + 10 + 9 + 11) ÷ 5 = 50 ÷ 5 = 10 cars, with results ranging from 8 to 12. Report the average and the range, not just one run.
3. A disease model predicts 500 cases by day 20, but the real count was 200. Give two things to check.
Check the parameters (maybe the chance of spreading is too high, or people meet fewer others) and the assumptions (maybe the model ignores masks, holidays or recovery). Change them and validate again against real data.
Common mistakes
- Thinking a model and a simulation are the same. The model is the description; the simulation runs it through time.
- Trusting one random run. Run many times and use the average and the spread.
- Believing a simulation gives the exact future. It gives a prediction that depends on its assumptions.
- Changing several parameters at once. Change one at a time to see what each one does.