Join free to take this lesson
Anyone can look around, but taking a lesson needs a free account. With one, your answers are checked step by step and your progress is saved, so you can stop and pick up where you left off on any device.
12 steps · about 30 min
By the end you can
- Keep the positions and velocities of many molecules in two arrays of N rows and 3 columns
- Move every molecule at once with pos = pos + vel * dt
- Make the walls bounce molecules back: out = (pos < 0) | (pos > L), then vel[out] = -vel[out]
- Watch a gas spread out to fill its box, and measure the share in one half
Who it is for: Anyone who has done units 5, 9, 15 and 17 of this course, and physics lessons 12.4-12.5 (gases) and 20.1 (microstates).
The steps
- A gas you can follow
- Every molecule in one array
- Fill the box
- Every molecule moves at once
- One line moves them all
- Walls that bounce
- Picking entries
- Bounce
- The gas spreads out
- Spreading out
- All back to the left?
- What made it spread?
Discussion 0 comments
Log in to join the discussion.