Description
Interactive simulation of the dynamics of two gases separated by a barrier that can be kept fixed or allowed to move. The initial velocities in each gas are generated randomly from the Maxwell–Boltzmann distribution, so the initial temperatures are close to, but not exactly equal to, the selected values.
Controls
Adjust the barrier opening and position, as well as the temperature, particle count, and atomic mass of each gas in the "Barrier" and "Gases" panels. When the barrier is movable, its position changes in response to the pressure difference between the two compartments. The "Graph" panel shows the temperature, particle count, and pressure in each compartment over time—click a legend entry to show or hide a curve.
Physical model
The initial velocity of each particle is sampled from the Maxwell–Boltzmann distribution so that the temperature of each gas corresponds to the mean kinetic energy of its particles,
$$
\frac{1}{2}m\langle v^2\rangle = \frac{3}{2}k_BT,
$$
and the particles evolve through elastic collisions with one another and with the container walls and barrier. The pressure in each compartment is obtained from the rate of momentum transfer per unit area during collisions with the walls.
Developers
Marco P. M. de Souza
References
Cassia E. de F. Ladeira,
Simulações Computacionais: um modelo simples para o resfriamento atômico (TCC Física, Universidade Federal de Rondônia, 2019).
View thesis
H. Moysés Nussenzveig, Curso de Física Básica: Fluidos, Oscilações e Ondas, Calor (Blucher, 2014).