Day 2 · 9:00–9:45 · Prof. Qi Wang & SDSU students

Physics Simulation

How computers model the real world — the science behind games, movies, engineering… and AI.

The question

How does a computer "know" physics?

It doesn't. It only knows numbers and rules.

A simulation = the world's state (positions, speeds) + the rules (forces) + a clock.

Tick the clock in tiny steps, apply the rules each tick — reality emerges.

The whole engine · live

Two lines of code run every game you've played

speed = speed + gravity × dt   height = height + speed × dt

Step size (dt) small & smooth · press P to pause

Cannon Challenge 🎯

LIVE GAME

Angle + power in, gravity does the rest — the same two lines of code flying the cannonball. Let students call out angles.

Same rule, new world: Orbit Lab 🪐

LIVE GAME

Identical gravity code — pointed at the sun instead of down — gives you the solar system. Flick too slow: crash. Too fast: escape. Just right: orbit.

A humbling truth · live

Chaos: tiny differences explode

Two double-pendulums, started 0.001° apart. Same rules, same computer — watch them disagree. This is why weather forecasts stop at ~10 days.

New idea · when the "thing" is everywhere

Smoke, heat, weather: chop the world into cells

  • 🎈 A ball has ONE position. But smoke? Heat? Weather? They're everywhere at once
  • 🔲 The trick: chop space into cells — each holds one number ("how much smoke here?")
  • 🌬️ Advection: the wind carries it — chimney smoke drifting downstream
  • ♨️ Diffusion: it spreads all by itself — perfume filling a room, milk swirling into tea
Every cell plays the same tiny game: look at your neighbors, update your number. That's ALL a weather supercomputer does — a billion times per second.
🌬️ ADVECTION — carried by the wind same puff, a few steps later ♨️ DIFFUSION — spreads on its own leaks BOTH ways, forever

Computor 🧑‍💻 — YOU are one cell

LIVE GAME — YOU DRIVE

One volunteer drives; the room predicts. Every ▶ Step = one tick of the future — and cell #8's arithmetic appears in plain left / me / right words with the answer. Predict, step, check… then crank ⏱️ Δt past the red line and meet the famous 💥.

Draw it, then watch it flow: Wind Tunnel 🌬️

LIVE GAME

Doodle any shape and the wind peels off it into a Kármán vortex street — the same swirls behind cars, wings & flags. Real turbulence, simulated live.

Why it matters

Test it in the computer before you build it

Simulation meets AI: Train the Cannon 🎯🧠

LIVE GAME

Don't aim it yourself — collect practice shots in the simulator, train a model by gradient descent, and watch it learn to hit new targets.

The honest part

Simulation ≠ reality

Recap

What you now know

Questions? 🙋

Up next at 9:45: AI World Models — what if the machine learns the rules itself?

Cannon, Orbit, Computor & Train-the-Cannon are all in the mini-games hub.