Would the temperature of a gas change when accelerated in a train? I was thinking about a situation where some gas is enclosed inside a container and kept in a train at rest. The train accelerates, gains a maximum speed and then suddenly stops. Would the temperature of the gas change during this process?
I know that temperature is directly proportional to average kinetic energy of gas molecules but would the train during this process change the kinetic energy of the gas molecules inside the closed container?
 A: In principle, YES.
Remember, temperature is related to the velocity distribution of the particles inside the gas. The key word here is $collision$.
Accelerating the train and suddenly stopping it is akin to shaking a container that contains fluid once. The sudden acceleration and deceleration of the contained will impart momentum from the wall of the container to the particles inside. I see two cases.
(a) If the container contains liquid and is not completely full, you could increase its temperature because you are imparting momentum of the particles inside the liquid by virtue of them sloshing inside the container.
(b) If the container contains liquid and is completely full, you could increase its temperature in the same principle but not significantly. Similarly, for a gas, while in principle you could have the same effect as in a container filled with gas, the density of the gas is so much lower than the liquid, the effect would have to be negligible. 
A: Interesting question! Thinking about this as two pistons of equal velocity - rather than a train carriage - helped me conceive the problem:
First, think about it as a continuum problem - you are talking about a gas, but for the acceleration stage I think this does not affect the picture materially. Taking the reference frame of the gas between the two pistons, and noting this is not an inertial reference frame during acceleration, then there will be higher pressure on the rear piston if the gas is undergoing linear acceleration [note that I have considered the acceleration as an inertial force - I think it helps to use the non-inertial reference frame of the gas]:
$$\sum F_x = P_1\cdot A - P_2\cdot A - \rho_{g,0}\cdot A\cdot L \cdot a_x = 0$$
Depending on the acceleration, you can now compute the pressure difference that would be observed, which depends on the density of the gas and the length of the cylinder and is independent of the area. Turning the problem on its side, it resembles the hydrostatic force balance (note that I have used the initial density; for strong accelerations, there will be a non-negligible density gradient opposite to the acceleration - but it doesn't affect this calculation).
If the acceleration is extremely gradual, then this pressure difference is extremely small, such that the acceleration could be considered 'quasistatic'. Under this scenario, the gas should acquire axial momentum without any change to its incoherent motion (in its reference frame). After the acceleration is removed, the pressures are equal on the front and rear pistons, and the gas has acquired a coherent kinetic energy of $\rho_g\cdot A\cdot L \cdot \frac{V_x^2}{2}$ (this is equal to the work done by the pistons - the train has had to accelerate this gas, and the kinetic energy is the 'deceleration potential energy' relative to a particular reference frame). The coherent component of kinetic energy can be separated from the incoherent kinetic energy of the gas (which is treated as one component of the internal energy):
$$u_1 + w = u_2 + \frac{V_2^2}{2}$$
By assuming the acceleration was quasistatic and adiabatic, the internal energy of the gas hasn't changed. Its density also hasn't changed, so the thermodynamic state of the gas is unchanged.
If the train were very gradually decelerated, then this process could be reversed - and the gas temperature would again be unchanged, and the work done decelerating the gas could be used to raise a weight, or coil a spring (or heat the brakes of the train for that matter). But this isn't what you asked.
Intuition suggests that the limiting case is where no work is extracted from the deceleration process - the container stops instantaneously, and it is an irreversible process. By conservation of energy, if the box is adiabatic and constant-volume:
$$u_2+\frac{V_2^2}{2} = u_3$$
If we were on a Maglev train, traveling at around 167 m/s, this would be 14 kJ/kg of coherent kinetic energy that goes to internal energy (incl. incoherent kinetic energy).
If the gas was room-temperature air, and we treat $c_v$ as constant with a value 718 J/kg.K, the temperature rise would then be:
$$\Delta T = \frac{\Delta u}{c_v} =  \frac{14000}{718} = 19 \mathrm{K}$$
A: The temperature is the kinetic energy of the gas molecules within the container. if you can measure the slightest of slightest variation in temperature of gas, then you will find temperature has increased. 
Train will rise the temperature of gas just by shaking it during travelling (Friction) and also when you suddenly stop the train, the gas slam on the containers one side & sudden buildup of pressure on the side causes temperature of the gas to go higher locally. Gas laws is applied here as the volume is fixed and change in pressure causes temperature to rise.
A: Yes the work done by the normal force applied by the train in decreasing would come in the form of increase in temperature.
You can use the formula$${KE_{sys}= KE_{w.r.t com}+KE_{of com}}$$
Actually the temperature is related to kinetic energy w.r.t centre of mass only. For instance two gas containers having same temperature but one moving in a train and other is at rest. We should not get different temperatures for both as temperature is not frame dependent. The velocities of the molecules change less but the velocity of the centre of mass changes hence temperature changes.
A: Actually, I think the answer would be relative.Lets say there are two observers A and B. Suppose, a train is moving at an acceleration of say, 5 m/s^2.For an observer at rest outside the train(Observer A) the temperature of the gas will definitely rise (very negligibly because the train is moving at slower speeds with respect to light). Whereas an observer(Observer B) inside the train will see no change in the temperature as according to the observer B the container of the gas and the particles of the gas are at rest and experience no acceleration.
