LearnsimulationFrame by Frame: How Simulations Step

Lesson · 8 min

Frame by Frame: How Simulations Step

Discrete time, tiny steps, and why the frame rate changes the answer.

Reality flows continuously, but computers measure time in frames. A simulation jumps: move everything a tiny step forward, recompute the forces, repeat ten, a hundred, a million times. Physics engines in games do this 30–120 times per second; weather models do it for the whole atmosphere in chunks of kilometers.

One step of a projectile

  • Forces: gravity pulls down (−9.81 m/s²); drag pushes against motion.
  • Velocity: v → v + a · dt — velocity changes by acceleration times the step size.
  • Position: x → x + v · dt — position moves by the new velocity.
  • Repeat until the projectile lands. That’s the whole engine.
Here’s the honest secret: the step size dt is a modeling assumption too. Big steps are fast and slightly wrong; tiny steps are accurate and expensive. In the lab you’ll compare a 30-frame simulation with a 120-frame one and see the gap yourself.

Every simulation you’ll ever meet — climate models, stock markets, game physics — makes this trade-off between fidelity and cost. Knowing it exists is the difference between using a simulation and trusting one.

Try it yourself

Try it — order

Order one step of a physics simulation's loop.

1Compute the forces acting right now (gravity, drag)
2Update position: x → x + v · dt
3Advance the clock by dt
4Update velocity: v → v + a · dt
5Repeat — or stop when the projectile lands

Knowledge check

1

A simulation redraws a projectile 30 times per second, jumping between frames. The jump size (dt) is…

2

If you shrink dt toward zero, the simulation becomes…

3

In the lab, the 30-frame and 120-frame integrations of the same launch disagree slightly. That disagreement is…