I was wondering how stars form and watched this video: https://youtu.be/mkktE_fs4NA?t=18s The lady says:
"Gravity brings matter together. And when you bring matter together, when you squeeze things into smaller spaces, they necessarily heat up, it's a simple law of chemistry."
But if we look at
PV=nRT, then temperature should go down.
I would really appreciate if someone could untangle things for me. Does the ideal gas law not apply for nebulas and I should be using thermodynamics, kinetic theory, or whatever other theory instead?
Also on a similar line, concerning
PV=nRT, which is a 3-way relation (between pressure, volume and temperature), if we simply decrease the volume of a system (in this case the nebulae), how should we expect pressure and temperature to behave? (in which cases would only one of them increase/decrease, and in which cases would temperature decrease and pressure increase?)
I am rather looking for a model/theory based answer, in the sorts of "energy-work theorem is really what you should be looking at, and from this we can derive all of these situations... etc."