### Change in temperature for an adiabatic process

Why does compressing a gas often increase the temperature, while allowing the volume to expand often leads to cooling? This simulation demonstrates the process, looking at a single atom in a cylinder. First, remember that temperature is directly tied to kinetic energy - if the atoms moves faster, on average, then the temperature has increased, and if the atoms move slower, the temperature has decreased.

Consider cylinder 2, which has a fixed volume. The atom collides elastically with the bottom of the piston. This reverses the direction of the atom's velocity but does not change the atom's kinetic energy, so the temperature does not change.

In cylinder 1, the atom collides elastically with the bottom of the piston, but the piston is moving down. This both reverses the direction of the atom's velocity and increases the speed of atom, so the temperature increases. We're modeling the collision as an elastic collision between a large-mass object (the piston) and a small-mass object (the atom). The collision essentially has no impact on the piston, and the relative speed between the piston and the atom remains the same before and after (because the collision is elastic). This has the effect of increasing the speed of the atom by twice the speed of the piston.

In cylinder 3, the atom collides elastically with the bottom of the piston, but the piston is moving up. This both reverses the direction of the atom's velocity and decreases the speed of atom, so the temperature decreases. Again, this collision essentially has no impact on the piston, and the relative speed between the piston and the atom remains the same before and after. This has the effect of decreasing the speed of the atom by twice the speed of the piston.

Simulation written by Andrew Duffy, and first posted on 6-13-2018.