User:XZise/Atmospheric Height

From Kerbal Space Program Wiki
< User:XZise
Revision as of 15:22, 26 December 2014 by Yoha (talk | contribs)
Jump to: navigation, search

Hey, I stumbled upon this one, when I worked on the Infobox/Body template at the Wiki.

Scale height

According to the wiki and wikipedia, the pressure at a specific height could be calculated by:

palt = p0 × e-alt/H

Atmosphere height

Atmospheric height in Kerbal Space Program is defined as the altitude where pressure falls bellow a millionth the pressure at sea level:

altatmo = -ln(10⁻⁶)×H

To check this, let us compute the pressure at altitude altatmo:

patmo = p0 × e-altatmo/H
= p0 × e-(-ln(10⁻⁶)×H)/H
= p0 × eln(10⁻⁶)
= p0 × 10⁻⁶

It checks out. Kerbin has pressure of 1 atm at sea level and 10⁻⁶ atm at atmospheric height; Jool has 15 atm at sea level and 15×10⁻⁶ atm left at atmospheric height.

Deriving altitude from pressure

Now, suppose we want to find where on Kerbin pressure is 15×10⁻⁶ atm. We simply reverse the scale height formula:

palt = p0 × e-alt/H | ÷p0
palt/p0 = e-alt/H | ln()
ln(palt/p0) = -alt/H | ×-H
-ln(palt/p0) × H = alt

This is very similar to the expression for altatmo. It makes sense since, in both case, we compute an altitude for a given pressure (absolute or relative to pressure at sea level).

Plugging in the values palt = 15×10⁻⁶ atm, p0 = 1 atm and H = 5000 m, it gives us the 55537.3018 meters above sea level.

Safe altitude

Since there is no drag effect on Jool right above atmospheric height with p = 15×10⁻⁶ atm, we could expect an orbit in Kerbin's atmosphere at this altitude (i.e. 56km) to be safe as well.

Note: since the threshold defining atmosphere height is relative to pressure at sea level, the pressure at atmosphere height is not guaranteed to actually be negligible

Kerbal Space Program uses a simplified model to allow logical acceleration by ignoring atmospheric drag above an arbitrary limit. In a more precise model of Kerbin, vessels would still experience orbital decay above 69km due to atmospheric drag. Since drag is actually taken into account below 69km, any orbit whose periapsis is below this altitude will ultimately decay in the game; however, even at 50km this would take a really long time (only physical ×4 acceleration would be available).

Finally, there is another trick to this: drag is not simulated at all on background vessels (e.g. dropped stages farther than 2.5km). Instead, the vessel can orbit safely even in the atmosphere (unless switched to), but is considered as having crashed if its altitude falls below some threshold It looks like this limit is around ~30km on Kerbin, but more Science © is needed to derive the way this is computed.

Science

After some sciencing, it appears that I was wrong: atmospheric effects are completely ignored when the vessel is not focused on (monitoring from Tracking Station). The only times my test vessel (Command Pod Mk1 + S3 KS-25x4 Engine Cluster + Infinite fuel) was removed from the list seems to be due to crashes into the terrain.

For instance, I was able to do full pass with a periapsis of 992 km. On the other hand, I experienced a crash while leaving a periapsis of ~1,200 m into a chain of mountains at altitude ~1,700 m, meaning that the collision box is not just a sphere either).

Fun fact: the periapsis threshold when the camera switches mode is between 23,024 m and 23,034 m. On Kerbin, it maps to an atmospheric pressure between 0.99837% and 1.00037% the pressure at sea level. And the altitude for 1% is 23,025.851m so I would say this defines the threshold indeed.