Because you are doing work to compress the gas, and the energy has to go somewhere. The molecules speed up because they collide with the wall moving forward--- if you move a wall forward, a ball which bounces off the wall reflects going faster by twice the speed of the wall, because if you move along with the wall, it reflects at the same speed.
Answers to comment questions
- After the gas cools off, the gas molecules are moving at the same speed as before.
- The second question is a form of Maxwell demon. If you know when the molecular collisions come with such precision that you can move the wall when the molecules will not bounce, you can compress the gas without doing any work. But in order to do this, you must get and store the information about where all the molecules are, a process which requires a huge amount of entropy production. The information about the molecules allows you to reduce their volume without increasing their energy.
- In any situation where classical mechanics works, for kinetic energy of gasses in particular, the temperature is just the same as the average molecular kinetic energy. For all nonrelativistic systems, the average kinetic energy in each atom is $3T\over 2$ in Boltzmann units (k=1). This is a special case of the equipartition law--- every quadratic degree of freedom gets ${kT\over 2}$ energy in equilibrium. Because of the relation between temperature and kinetic energy, the speeds of molecules in two gasses at the same temperature are the same. So after the gas comes to equilibrium with the surroundings, it has the same average speed for the molecules independent of its volume (this is a molecular kinetic-energy potential-energy separation theorem, which is even true when the material liquifies or solidifies, at least at room temperature where normal solids obey the Dulong Petit law).
Entropy increase
There is a second way to understand the temperature increase. When you squeeze the gas, you are increasing your knowledge of where the molecules are, you are decreasing their wandering volume. This means that, if nothing else happens, you decrease their entropy. So something must have happened to make you know less about the state of the universe. If they are not allowed to dump heat and entropy into the exterior universe, the only thing that can happen is that they move faster, increasing your uncertainty about how fast they are going.
The decrease in entropy with a decrease in volume from $V_i$ to $V_f$ is
$$ N\log({V_f\over V_i}) $$
This is intuitive--- the logarithm of the number of configuration is the log of $V^N$ (ignoring an N! denominator from indistinguishable particles.
The increase in entropy from a change in temperature from $T_i$ to $T_f$ is given by
$$ NC_V \log({T_f\over T_i}) $$
Where $C_v$ is the rate of entropy increase per unit temperature. So that the relation that the entropy is constant gives the adiabatic expansion law: $V\over T^{C_v}$ is constant, that is, the ratio of absolute temperatures before and after is a certain power of the ratio of the volumes after and before.
I should point out that if you move the piston extremely quickly, at comparable to the speed of sound of the gas, you will produce extra heat in addition to the minimum necessary to ensure the entropy doesn't go down. The extra heat can be understood in two equivalent ways:
- you are overcompressing a thin skin of gas near the piston, that momentarily exerts a greater back-pressure on the piston than the gas would normally if you did things slowly. So you are doing more work to compress the gas quickly.
- You are learning more about the positions of the molecules from the slow rate of pressure relaxation--- you know that a large fraction of the volume of the gas is mushed near the piston.
This is a classical more-you-know less-you-know statement, that the more precisely you know where the molecules in a gas are, the less precisely you know how fast they are moving (the hotter the gas gets), at constant information (entropy). This is not the Heisenberg uncertainty principle, it is just classical thermodyanamics, and here the knowledge interpretation is exact, because the entropy is a measure of classical knowledge you have about the microstate. The quantum mechanical uncertainty principle is not a statement of ignorance about hidden variables, at least not in any obvious way, so it doesn't have a precise informational interpretation like this does.
No you cannot.
we can show that (via conservation of kinetic energy and momentum) the speed of the particle before and after collision is the same.
Only in the center of mass of two elastically colliding particles the momentum remains the same. Each pairwise collision has a different center of mass. In the laboratory frame, which is the frame one is trying to model the ideal gas, all the momentum might be taken by one of the particles, leaving the other motionless in the lab. This happens with billiard ball collisions all the time. See this analysis. So even if one made an experimental setup with all the particles of the ideal gas with the same speed, after the first scatter, speeds will change because they will not all be head on, there will be angles, and then the laboratory versus center of mass argument prevails.
The distribution functions for the ideal gas were given by Maxwell using simple and reasonable assumptions. Boltzman refined this.
It is a model, i.e. a theoretical formula, that has been validated by data over and over again.
Best Answer
Assuming an ideal gas, if you are keeping the average speed of the molecules the same then you are holding the temperature of the gas constant. Assuming the container keeps the same volume, by the ideal gas law it must be that the pressure of the gas increases as you add more molecules.
Yes there are more molecules hitting the thermometer, but that also means there are more molecules hitting the thermometer. What I mean by this is that energy can be transferred to the thermometer at a higher rate due to collisions, but collisions at the same increased rate will then transfer that energy from the thermometer back to the gas (and the same vice versa). This is how thermal equilibrium works.
So no, just because you have more gas at the same temperature doesn't mean you will record a higher temperature. More gas will just mean fewer fluctuations about the same temperature.
In addressing points made in the comments, technically the temperature of the thermometer will be somewhere between the starting temperature of the thermometer and the starting temperature of the gas, and the final temperature of the thermometer will approach the starting temperature of the gas as more gas is let in. However, there will come a point where additional gas will make the final temperature indistinguishable from the initial gas temperature, and ideally the thermometer shouldn't influence the temperature of the gas.