<p>Or if the math of the other answers is a bit complex, in a broad sense, the balancing relationship is: <span class="math-container">$$\frac{\mathrm{density} \cdot \mathrm{temperature}}{\mathrm{pressure}} = \mathrm{constant}$$</span></p>
<p>For compression, that's pretty straightforward: higher pressure forces higher density and temperature.</p>
<p>In the atmosphere, that balance still endures.  But there can be <a href="https://en.wikipedia.org/wiki/High-pressure_area#:%7E:text=The%20subtropical%20ridge%20is%20a,these%20climatological%20high-pressure%20systems.&amp;text=Arctic%20high-pressure%20systems%20such,that%20they%20weaken%20with%20height." rel="nofollow noreferrer">warm highs</a>, <a href="https://www.theweatherprediction.com/habyhints2/613/" rel="nofollow noreferrer">warm lows</a>, <a href="https://en.wikipedia.org/wiki/Polar_High" rel="nofollow noreferrer">cold highs</a>, and <a href="https://en.wikipedia.org/wiki/Cold-core_low" rel="nofollow noreferrer">cold lows</a>, depending upon density distribution.</p>
<p>The formation of such areas of pressure extreme is intimately connected to the three-dimensional structure of the atmosphere ... atmospheric pressure is [basically] the weight of air above ... vertical motion is heavily driven by buoyancy [air's density compared to air around it] ... and forces at a distance induce air motion [wind is related to the gradient of pressure and other forces].</p>
<p>All of which is to say there are a lot of interactions which allow for a rich variety of pressure-temperature-density balances, the 3-dimensional structures of those systems, and the resulting wind, precipitation, etc.  There's a whole focus of thermodynamics that looks <a href="https://opentextbc.ca/universityphysicsv2openstax/chapter/thermodynamic-processes/#:%7E:text=An%20adiabatic%20process%2C%20during%20which,system%27s%20volume%20does%20not%20change" rel="nofollow noreferrer">at the variety of controls in processes</a> which can lead to different results.</p>
<p>But in the end, that balance between ρ, P, and T in gases is what matters, and the factor you overlooked is that <strong>density and pressure are not the same thing</strong>.  It may seem like how much pressure is exerted by\upon a gas is the same as how compressed the mass of air actually is... but it's not... how fast the molecules in the gas move (which is its temperature) is the third factor, and there are ways that any two can change, or all three change at the same time, but the overall balance remains.</p>

CC BY-SA 4.0
2021-11-20T07:17:42.613Z
It may be best to think of volume as the third variable (as density = mass\volume, and unless gas is being added\lost from the area you are considering, density and volume are inverses of each other).  Though either work.
JeopardyTempest
CC BY-SA 4.0
2021-11-20T07:16:21.323Z
2021-11-20T07:16:21.323Z
JeopardyTempest
<p>Compression and expansion of an ideal gas is an adiabatic process, i.e. the entropy <span class="math-container">$\rm (P\rho^{-\gamma}) = const$</span>, where <span class="math-container">$\gamma$</span> is the adiabatic constant.<br />
You can rearrange this using the ideal gas closure relation <span class="math-container">$\rm P=\rho kT/\mu$</span> to find <span class="math-container">$\rm (T\rho^{1-\gamma}) = const.$</span>, which is essentially the statement you gave prior, that compressed gases are hotter (becasue <span class="math-container">$\gamma&gt;1 $</span> for realistic gases) if their entropy remains constant.</p>
<p>The air in the atmosphere however does not have constant entropy, and thus its <span class="math-container">$T(\rho)$</span>-behaviour is different from the adiabatic one. Instead, it follows a force-balance, i.e. the hydrostatic law <span class="math-container">$\partial P/\partial r = -g(r) \rho(r)$</span> and <span class="math-container">$g(r) = -GM/r^2$</span>. The resulting density structure from this is <span class="math-container">$\rho(r) = \rho_0 \times \exp(-H(\frac{1}{r}-\frac{1}{r_0}))$</span> with the atmospheric density scale height <span class="math-container">$H=kT/GM \mu$</span> and 0-index quantities denote density and radius on the surface.<br />
Now we just have to relate <span class="math-container">$\rho_0$</span> to other, known quantities, which we can do when assuming that the entirety of the atmospheric mass <span class="math-container">$\rm M_{atmo}$</span> is contained in one scale height of the atmosphere, then we get <span class="math-container">$\rm M_{atmo} = 4\pi \rho_0 H R_0^2$</span>.<br />
One immediately sees that <span class="math-container">$\rm \rho_0 \sim 1/H \sim 1/T$</span>. This shows that for a colder atmosphere (smaller H), the density on the ground must be larger, when following the force balance instead of entropy conservation.</p>
<p><strong>Short, less-mathy summary:</strong></p>
<p>Compressed gas naturally heats up. If no exchange of heat with the environment occurs, then after some time we can expand the gas, to cool it back to its exact same initial temperature.<br />
This is called an adiabatic process, kind of a central vocabulary from thermodynamics.</p>
<p>Now if we allow for a process to be diabatic, i.e. we allow for the gas to exchange energy with the environment, then it's temperature cannot be set by the adiabatic condition. Instead, we must look to what else is acting on the gas.<br />
A planet's atmosphere is kept by its gravity, and it is the gravitational energy which sets a different behaviour: In a gravitational field, a cold gas volume must be a compressed compressed one, because it does not have enough pressure to resist gravity. Hot gas can expand far up the gravity well of a planet.</p>
<p>This is a bit simplified, as one can of course also have an adiabatic gas in a gravitational field, but I would only go there in this answer, if there is interest.</p>

CC BY-SA 4.0
2021-11-19T18:57:42.697Z
2021-11-22T21:36:41.650Z
2021-11-22T21:36:41.650Z
AtmosphericPrisonEscape
<p>I'm trying to reconcile a paradox regarding air pressure and temperature.</p>
<p>On the one hand, compressing air heats it up, while expanding it cools it. So density and temperature are proportional.</p>
<p>On the other hand, warm air in the atmosphere is a low pressure system and cold air is a high pressure system. So density and temperature are inversely proportional.</p>
<p>What am I missing in order to reconcile the two?</p>

CC BY-SA 4.0
2021-11-19T15:37:04.447Z
Hi @Steven ! Take the two cases' conditions, i.e. closed container and open atmosphere. In the former, heating will increase gas pressure on the container's wall. In the latter, heating air will result in atmospheric instability> moving wind and less dense air> lighter atmospheric column weight> low air pressure on the surface. " > "means leading to. I hope this helps :)
ahmathelte
CC BY-SA 4.0
2021-11-20T05:11:21.723Z
Thank you @ahmathelte, the open vs. closed container metaphor really helped! If you'd like to put that in an answer, I can accept it
Steven
CC BY-SA 4.0
2021-11-20T12:57:43.267Z
@Steven You can accept that answer, but it's just wrong.
AtmosphericPrisonEscape
CC BY-SA 4.0
2021-11-21T22:12:12.253Z
@AtmosphericPrisonEscape honestly I don't see their answer being fundamentally wrong, just a bit off tangent (the question wasn't about heating... but does seem right that confinement in a closed container results in p ↑, while without confinement it is heavily a ρ ↓. I admit the explanation of the ρ decrease does go awry in mentioning instability, as the T change itself causes expansion and ρ ↓, but that seems fixable and perhaps some terminology trouble...
JeopardyTempest
CC BY-SA 4.0
2021-11-21T22:18:59.653Z
... certainly you show you understand the topic better than I\others. But your answer seems a bit complex compared to the question... I can picture Steven as a grade school or general uni student, without the deeper physics foundations you hit, and so it may generally go over his head and the head of many others; I'll admit, it's a bit a challenging read even for me these days, and I have the degrees\could handle it once upon a time. So it's not to say your answer is wrong, it's likely about perfect in its internals, it may just miss the audience... maybe you can summarize for wider readers?
JeopardyTempest
CC BY-SA 4.0
2021-11-22T21:17:50.590Z
@JeopardyTempest: Thanks for the input, I'll add a TLDR;
AtmosphericPrisonEscape
CC BY-SA 4.0
2021-11-24T19:44:31.850Z
@Steven, it is not an answer (at least to me), I was trying to brainstorm with you! I believe answers here should be provided with proper citations and adequate explanations. Best, :)
ahmathelte
<meteorology><temperature><fluid-dynamics><pressure><air>
What is the relationship between air pressure and temperature?
Steven
# What is the relationship between air pressure and temperature?

(Asked by: username_0 on 2021-11-19)

I'm trying to reconcile a paradox regarding air pressure and temperature.

On the one hand, compressing air heats it up, while expanding it cools it. So density and temperature are proportional.

On the other hand, warm air in the atmosphere is a low pressure system and cold air is a high pressure system. So density and temperature are inversely proportional.

What am I missing in order to reconcile the two?

**Tags:** meteorology, temperature, fluid-dynamics, pressure, air

> **Comments:**
> **username_1**: Hi @username_0 ! Take the two cases' conditions, i.e. closed container and open atmosphere. In the former, heating will increase gas pressure on the container's wall. In the latter, heating air will result in atmospheric instability> moving wind and less dense air> lighter atmospheric column weight> low air pressure on the surface. " > "means leading to. I hope this helps :)  
> **username_0**: Thank you @username_1, the open vs. closed container metaphor really helped! If you'd like to put that in an answer, I can accept it  
> **username_2**: @username_0 You can accept that answer, but it's just wrong.  
> **username_3**: @username_2 honestly I don't see their answer being fundamentally wrong, just a bit off tangent (the question wasn't about heating... but does seem right that confinement in a closed container results in p ↑, while without confinement it is heavily a ρ ↓. I admit the explanation of the ρ decrease does go awry in mentioning instability, as the T change itself causes expansion and ρ ↓, but that seems fixable and perhaps some terminology trouble...  
> **username_3**: ... certainly you show you understand the topic better than I\others. But your answer seems a bit complex compared to the question... I can picture username_0 as a grade school or general uni student, without the deeper physics foundations you hit, and so it may generally go over his head and the head of many others; I'll admit, it's a bit a challenging read even for me these days, and I have the degrees\could handle it once upon a time. So it's not to say your answer is wrong, it's likely about perfect in its internals, it may just miss the audience... maybe you can summarize for wider readers?  
> **username_2**: @username_3: Thanks for the input, I'll add a TLDR;  
> **username_1**: @username_0, it is not an answer (at least to me), I was trying to brainstorm with you! I believe answers here should be provided with proper citations and adequate explanations. Best, :)  

---

## 2 answers

### Answer by username_3 on 2021-11-20. Score: 2 | Accepted answer

Or if the math of the other answers is a bit complex, in a broad sense, the balancing relationship is: $$\frac{\mathrm{density} \cdot \mathrm{temperature}}{\mathrm{pressure}} = \mathrm{constant}$$

For compression, that's pretty straightforward: higher pressure forces higher density and temperature.

In the atmosphere, that balance still endures. But there can be [warm highs](https://en.wikipedia.org/wiki/High-pressure_area#:%7E:text=The%20subtropical%20ridge%20is%20a,these%20climatological%20high-pressure%20systems.&text=Arctic%20high-pressure%20systems%20such,that%20they%20weaken%20with%20height.), [warm lows](https://www.theweatherprediction.com/habyhints2/613/), [cold highs](https://en.wikipedia.org/wiki/Polar_High), and [cold lows](https://en.wikipedia.org/wiki/Cold-core_low), depending upon density distribution.

The formation of such areas of pressure extreme is intimately connected to the three-dimensional structure of the atmosphere ... atmospheric pressure is [basically] the weight of air above ... vertical motion is heavily driven by buoyancy [air's density compared to air around it] ... and forces at a distance induce air motion [wind is related to the gradient of pressure and other forces].

All of which is to say there are a lot of interactions which allow for a rich variety of pressure-temperature-density balances, the 3-dimensional structures of those systems, and the resulting wind, precipitation, etc. There's a whole focus of thermodynamics that looks [at the variety of controls in processes](https://opentextbc.ca/universityphysicsv2openstax/chapter/thermodynamic-processes/#:%7E:text=An%20adiabatic%20process%2C%20during%20which,system%27s%20volume%20does%20not%20change) which can lead to different results.

But in the end, that balance between ρ, P, and T in gases is what matters, and the factor you overlooked is that **density and pressure are not the same thing**. It may seem like how much pressure is exerted by\upon a gas is the same as how compressed the mass of air actually is... but it's not... how fast the molecules in the gas move (which is its temperature) is the third factor, and there are ways that any two can change, or all three change at the same time, but the overall balance remains.

> **Comments:**
> **username_3**: It may be best to think of volume as the third variable (as density = mass\volume, and unless gas is being added\lost from the area you are considering, density and volume are inverses of each other).  Though either work.  

---

### Answer by username_2 on 2021-11-19. Score: 1

Compression and expansion of an ideal gas is an adiabatic process, i.e. the entropy $\rm (P\rho^{-\gamma}) = const$, where $\gamma$ is the adiabatic constant.  
You can rearrange this using the ideal gas closure relation $\rm P=\rho kT/\mu$ to find $\rm (T\rho^{1-\gamma}) = const.$, which is essentially the statement you gave prior, that compressed gases are hotter (becasue $\gamma>1 $ for realistic gases) if their entropy remains constant.

The air in the atmosphere however does not have constant entropy, and thus its $T(\rho)$-behaviour is different from the adiabatic one. Instead, it follows a force-balance, i.e. the hydrostatic law $\partial P/\partial r = -g(r) \rho(r)$ and $g(r) = -GM/r^2$. The resulting density structure from this is $\rho(r) = \rho\_0 \times \exp(-H(\frac{1}{r}-\frac{1}{r\_0}))$ with the atmospheric density scale height $H=kT/GM \mu$ and 0-index quantities denote density and radius on the surface.  
Now we just have to relate $\rho\_0$ to other, known quantities, which we can do when assuming that the entirety of the atmospheric mass $\rm M\_{atmo}$ is contained in one scale height of the atmosphere, then we get $\rm M\_{atmo} = 4\pi \rho\_0 H R\_0^2$.  
One immediately sees that $\rm \rho\_0 \sim 1/H \sim 1/T$. This shows that for a colder atmosphere (smaller H), the density on the ground must be larger, when following the force balance instead of entropy conservation.

**Short, less-mathy summary:**

Compressed gas naturally heats up. If no exchange of heat with the environment occurs, then after some time we can expand the gas, to cool it back to its exact same initial temperature.  
This is called an adiabatic process, kind of a central vocabulary from thermodynamics.

Now if we allow for a process to be diabatic, i.e. we allow for the gas to exchange energy with the environment, then it's temperature cannot be set by the adiabatic condition. Instead, we must look to what else is acting on the gas.  
A planet's atmosphere is kept by its gravity, and it is the gravitational energy which sets a different behaviour: In a gravitational field, a cold gas volume must be a compressed compressed one, because it does not have enough pressure to resist gravity. Hot gas can expand far up the gravity well of a planet.

This is a bit simplified, as one can of course also have an adiabatic gas in a gravitational field, but I would only go there in this answer, if there is interest.


---

