[Physics] What happens to the temperature when an ideal gas is compressed

ideal-gaspressuretemperaturethermodynamicsvolume

I am rather confused about this. I know from Charles' law that under constant pressure, the volume of a gas is directly proportional to its absolute temperature i.e.

$$\frac{V_1}{T_1} = \frac{V_2}{T_2}$$

Thus accordingly, during compression, temperature of the gas would decrease. But in Lectures of physics ,vol 1 by Feynman, it is written:

Suppose that the piston moves inward, so that the atoms are slowly compressed into a smaller space. What happens when an atom hits the moving piston? Evidently it picks up speed from the collision. […] So the atoms are "hotter" when they come away from the piston than they were before they struck it. Therefore all the atoms which are in the vessel will have picked up speed. This means that when we compress a gas slowly, the temperature of the gas increases.

(Constant pressure?) So, this is contrary to Charles' law. Why does this happen? Who is right? Or are they both correct? I am confused. Help.

Best Answer

There's actually not one simple answer to your question, which is why you are a bit confused. To specify your problem fully, you must specify exactly how and whether the gas swaps heat with its surroundings and how or even whether it is compressed. You should always refer to the full gas law $P\,V=n\,R\,T$ when reasoning. Common situations that are considered are:

  1. Charles's Law: The pressure on the volume gas is constant. No work is done by the gas on its surroundings, nor does the gas do any work on its surroundings or piston or whatever during any change. The gas's temperature is that of its surroundings. If the ambient temperature rises / falls, heat is transferred into / out from the gas and its volume accordingly increases / shrinks so that the gas's pressure can stay constant: $V = n\,R\,T/P$; with $P$ constant, you can retrieve Charles's Law;

  2. Isothermal: the gas is compressed / expanded by doing work on / allowing its container to do work on its surroundings. You think of it inside a cylinder with a piston. As it does so, heat leaves / comes into the gas to keep the temperature constant. As the gas is compressed, the work done on it shows up as increased internal energy, which must be transferred to the surroundings to keep the temperature constant. At constant temperature, the gas law becomes $P\propto V^{-1}$;

  3. Adiabatic: No heat is transferred between the gas and its surroundings as it is compressed / does work. AGain, you think of the gas in a cylinder with a plunger. This is prototypical situation Feynman talks about. As you push on the piston and change the volume $V\mapsto V-{\rm d}V$, you do work $-P\,{\rm d}V$. This energy stays with the gas, so it must show up as increased internal energy, so the temperature must rise. Get a bicycle tyre pump, hold your finger over the outlet and squeeze it hard and fast with your other hand: you'll find you can warm the air up inside it quite considerably (put you lips gently on the cylinder wall to sense the rising temperature). This situation is described by $P\,{\rm d}V = -n\,\tilde{R}\,{\rm d} T$. The internal energy is proportional to the temperature and the number of gas molecules, and it is negative if the volume increases (in which case the gas does work on its surroundings). But the constant $\tilde{R}$ is not the same as $R$: it depends on the internal degrees of freedom. For instance, diatomic molecules can store vibrational as well as kinetic energy as their bond length oscillates (you can think of them as being held together by elastic, energy storing springs). So, when we use the gas law to eliminate $P = n\,R\,T/V$ from the equation $P\,{\rm d}V = -n\,\tilde{R}\,{\rm d} T$ we get the differential equation:

$$\frac{{\rm d} V}{V} = - \frac{\tilde{R}}{R}\frac{{\rm d} T}{T}$$

which integrates to yield $(\gamma-1)\,\log V = -\log T + \text{const}$ or $T\,V^{\gamma-1} = \text{const}$, where $\gamma=\frac{R}{\tilde{R}}+1$ is called the adiabatic index and is the ratio of the gas's specific heat at constant pressure to the specific heat at constant volume.