You will build the pressure of a gas from single molecules hitting one wall.
The idea. A molecule moving at in a box of length hits one wall times each second. Each hit gives the wall the momentum . So its average force is . Add the forces of all the molecules, and divide by the area of the wall.
Your tasks.
hits_per_second, return how many times a molecule hits one wall each second.force_one, return the average force of one molecule on the wall.wall_pressure, the list vxs holds the x velocities of many molecules. Return the pressure on one wall of a cube of side L.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…