Difference between revisions of "Template:Body data/alt at pressure"

From Kerbal Space Program Wiki
Jump to: navigation, search
m (+cat; +examples;)
m (Update pressures taken from KSP 1.4)
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<includeonly>{{#ifexpr: {{BodyData/Pressure|{{{body}}}}}>0|{{#expr: -{{BodyData/ScaleHeight|{{{body}}}}} * ln({{{pressure}}} / {{BodyData/Pressure|{{{body}}}}}   ) }}|0}}</includeonly>
+
<includeonly>{{#ifexpr: {{Body data|{{{body}}}|pressure}}>0|{{#switch: {{{body}}} {{{pressure}}}
<noinclude>Calculates the height at which the specified pressure is in meters. Returns 0 if the celestial body hasn't any atmosphere. For example 0.000001&nbsp;atm (or 10<sup>-6</sup>&nbsp;atm) are at the following altitudes:
+
| Eve 0.02 = 46315
 +
| Eve 0.04 = 44226
 +
| Kerbin 0.02 = 23547
 +
| Kerbin 0.04 = 20004
 +
| Duna 0.02 = 14912
 +
| Duna 0.04 = 10689
 +
| Jool 0.02 = 134228
 +
| Jool 0.04 = 126238
 +
| Laythe 0.02 = 31829
 +
| Laythe 0.04 = 25146
 +
| #default={{#expr: -{{Body data|{{{body}}}|scale height}} * ln({{{pressure}}} / {{Body data|{{{body}}}|pressure}})}}}}|0}}</includeonly>
 +
<noinclude>
 +
{{Outdated|
 +
* Unfortunately this is currently not accurate for many cases, due to the atmospheric physics changes in [[1.0]].
 +
* Fixing it is not a simple task.
 +
* It is currently hard wired to provide static values for 0.02 and 0.04 on the bodies with atmosphere, as the default pressures for parachute semi-deployment.  Other pressure will use an outdated formula to calculate the result.  See [[Talk:Parachute#Semi-deployment altitudes]].
 +
}}
 +
Calculates the height at which the specified pressure is in meters. Returns 0 if the celestial body hasn't any atmosphere. For example 0.000001&nbsp;atm (or 10<sup>-6</sup>&nbsp;atm) are at the following altitudes:
 
{| class="wikitable"
 
{| class="wikitable"
 
! Body
 
! Body
Line 7: Line 24:
 
|-
 
|-
 
| [[Eve]]
 
| [[Eve]]
| <tt><nowiki>{{PressureAltitude|pressure=10^-6|body=Eve}}</nowiki></tt>
+
| <tt><nowiki>{{Body data/alt at pressure|pressure=10^-6|body=Eve}}</nowiki></tt>
| {{PressureAltitude|pressure=10^-6|body=Eve}}
+
| {{Body data/alt at pressure|pressure=10^-6|body=Eve}}
 
|-
 
|-
 
| [[Kerbin]]
 
| [[Kerbin]]
| <tt><nowiki>{{PressureAltitude|pressure=10^-6|body=Kerbin}}</nowiki></tt>
+
| <tt><nowiki>{{Body data/alt at pressure|pressure=10^-6|body=Kerbin}}</nowiki></tt>
| {{PressureAltitude|pressure=10^-6|body=Kerbin}}
+
| {{Body data/alt at pressure|pressure=10^-6|body=Kerbin}}
 
|-
 
|-
 
| [[Duna]]
 
| [[Duna]]
| <tt><nowiki>{{PressureAltitude|pressure=10^-6|body=Duna}}</nowiki></tt>
+
| <tt><nowiki>{{Body data/alt at pressure|pressure=10^-6|body=Duna}}</nowiki></tt>
| {{PressureAltitude|pressure=10^-6|body=Duna}}
+
| {{Body data/alt at pressure|pressure=10^-6|body=Duna}}
 
|-
 
|-
 
| [[Jool]]
 
| [[Jool]]
| <tt><nowiki>{{PressureAltitude|pressure=10^-6|body=Jool}}</nowiki></tt>
+
| <tt><nowiki>{{Body data/alt at pressure|pressure=10^-6|body=Jool}}</nowiki></tt>
| {{PressureAltitude|pressure=10^-6|body=Jool}}
+
| {{Body data/alt at pressure|pressure=10^-6|body=Jool}}
 
|-
 
|-
 
| [[Laythe]]
 
| [[Laythe]]
| <tt><nowiki>{{PressureAltitude|pressure=10^-6|body=Laythe}}</nowiki></tt>
+
| <tt><nowiki>{{Body data/alt at pressure|pressure=10^-6|body=Laythe}}</nowiki></tt>
| {{PressureAltitude|pressure=10^-6|body=Laythe}}
+
| {{Body data/alt at pressure|pressure=10^-6|body=Laythe}}
 
|}
 
|}
 +
 +
This template uses {{Tl|Body data}} with the <tt>scale height</tt> and <tt>pressure</tt> properties.
  
 
== Parameters ==
 
== Parameters ==
Line 39: Line 58:
 
|}
 
|}
  
[[Category:Templates|PressureAltitude]]</noinclude>
+
[[Category:BodyData Math Templates]]</noinclude>

Latest revision as of 15:55, 10 May 2018



Calculates the height at which the specified pressure is in meters. Returns 0 if the celestial body hasn't any atmosphere. For example 0.000001 atm (or 10-6 atm) are at the following altitudes:

Body Code Result
Eve {{Body data/alt at pressure|pressure=10^-6|body=Eve}} 111059.62898687
Kerbin {{Body data/alt at pressure|pressure=10^-6|body=Kerbin}} 77366.8591246
Duna {{Body data/alt at pressure|pressure=10^-6|body=Duna}} 63312.524205789
Jool {{Body data/alt at pressure|pressure=10^-6|body=Jool}} 495706.82367555
Laythe {{Body data/alt at pressure|pressure=10^-6|body=Laythe}} 106437.47971453

This template uses {{Body data}} with the scale height and pressure properties.

Parameters

Name Description
body Celestial body which is referenced
pressure Searched pressure in atm