Difference between revisions of "Template:VT"

From Kerbal Space Program Wiki
Jump to: navigation, search
m (Fix pressure-to-density multiplier.)
m (Use new mass template)
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<includeonly>{{#</includeonly>expr: <!--
+
<includeonly>{{#expr: <!--
 
-->    ( <!--
 
-->    ( <!--
-->        2 * {{G}} * {{#ifeq: {{{planet}}} | Moho  | 3.6747079E+21 | <!-- mass
+
-->        2 * {{G}} * {{Body data/Mass|{{{planet|{{{1}}}}}}}} <!--
-->                    {{#ifeq: {{{planet}}} | Eve    | 1.2244127E+23 | <!--
 
-->                    {{#ifeq: {{{planet}}} | Kerbin | 5.2915793E+22 | <!--
 
-->                    {{#ifeq: {{{planet}}} | Duna  | 4.5154812E+21 | <!--
 
-->                    {{#ifeq: {{{planet}}} | Jool  | 4.2332635E+24 | <!--
 
-->                    {{#ifeq: {{{planet}}} | Laythe | 2.9397663E+22 | <!--
 
-->                    }} }} }} }} }} }} <!--
 
 
-->        / ( <!--
 
-->        / ( <!--
-->            ({{{alt}}} + {{#ifeq: {{{planet}}} | Moho  |  250000 | <!-- planet radius
+
-->            ({{{alt|{{{2}}}}}} + {{Body data|{{{planet|{{{1}}}}}}|radius}} <!--
-->                          {{#ifeq: {{{planet}}} | Eve    |  700000 | <!--
 
-->                          {{#ifeq: {{{planet}}} | Kerbin |  600000 | <!--
 
-->                          {{#ifeq: {{{planet}}} | Duna  |  320000 | <!--
 
-->                          {{#ifeq: {{{planet}}} | Jool  | 6000000 | <!--
 
-->                          {{#ifeq: {{{planet}}} | Laythe |  500000 | <!--
 
-->                          }} }} }} }} }} }} <!--
 
 
-->            )^2 * <!--
 
-->            )^2 * <!--
-->            ( {{#ifeq: {{{planet}}} | Moho  |  0.005 * e^(-{{{alt}}} / 2000) | <!-- atmospheric pressure
+
-->            ( {{Body data|{{{planet|{{{1}}}}}}|pressure}} * e^(-{{{alt|{{{2}}}}}}/{{Body data|{{{planet|{{{1}}}}}}|scale height}}) <!--
-->              {{#ifeq: {{{planet}}} | Eve    |  5    * e^(-{{{alt}}} / 7000) | <!--
+
-->            ) * (1.2230948554874 * 0.008) * 0.2 * 1 <!--
-->              {{#ifeq: {{{planet}}} | Kerbin |  1    * e^(-{{{alt}}} / 5000) | <!--
 
-->              {{#ifeq: {{{planet}}} | Duna  |  0.2  * e^(-{{{alt}}} / 3000) | <!--
 
-->              {{#ifeq: {{{planet}}} | Jool  | 15    * e^(-{{{alt}}} / 9000) | <!--
 
-->              {{#ifeq: {{{planet}}} | Laythe |  0.8  * e^(-{{{alt}}} / 4000) | <!--
 
-->              }} }} }} }} }} }} <!--
 
-->            ) * (1.223125 * 0.008) * 0.2 * 1 <!--
 
 
-->        ) <!--
 
-->        ) <!--
-->    ) ^ 0.5<includeonly>}}</includeonly><noinclude>
+
-->    ) ^ 0.5 {{#if: {{{3|{{{round|}}}}}}|round {{{3|{{{round}}}}}}}}}}</includeonly><noinclude>
  
 +
{{Outdated|
 +
* This is almost certainly outdated due to the atmospheric physics changes in [[1.0]].
 +
}}
 
{| class="wikitable"
 
{| class="wikitable"
 
! Usage || Produces
 
! Usage || Produces
Line 34: Line 19:
 
|}
 
|}
  
This template calculates terminal velocity of an object given the planet and the altitude from the planet's surface. It assumes that the coefficient of drag is 0.2 and that the cross-sectional area is 1 m<sup>2</sup>. It also assumes that atmospheric density is equal to the atmospheric pressure multiplied by 1.223125 * 0.008.<ref>"density as a function of height in this equation is given by 1.223125 x 0.008 x Exp[-height/5000 meters]" [http://forum.kerbalspaceprogram.com/showthread.php/13403-Air-density-on-Kerbin?p=196742&viewfull=1#post196742]</ref>
+
This template calculates terminal velocity of an object given the planet and the altitude from the planet's surface. It uses {{Tl|Body data}} with the properties <tt>mass</tt>, <tt>radius</tt>, <tt>pressure</tt> and <tt>scale height</tt>.
  
== Notes ==
+
{{Parameter table|name=both|parameters=
<references />
+
{{Parameter row|1|name2=planet|The celestial body}}
 +
{{Parameter row|2|name2=alt|The altitude at which the terminal velocity should be calculated.}}
 +
{{Parameter row|3|name2=round|Round to the given number of decimal places.|Not set/Doesn't round}}
 +
}}
  
[[Category:Templates|VT]]
+
: <math>v_T = \sqrt{\frac{250 \frac{\text{kg}}{\text{m}^2} \cdot GM}{(a+r)^2 \cdot \rho \cdot d}}</math>
 +
: <math>\rho = 1.2230948554874 \frac{\text{kg}}{\text{m}^3 \cdot \text{atm}} \cdot p_0 \cdot e^\frac{-a}{H}</math>
 +
<small>(<tt>M</tt> is the mass of the body, <tt>r</tt> is the body's radius, <tt>p<sub>0</sub></tt> is pressure at 0 m altitude (“sea level”), <tt>a</tt> is the altitude above sea level and <tt>H</tt> is the scale height)</small>
 +
 
 +
The formula assumes that the coefficient of drag (d) is 0.2 and is used from the [[atmosphere]] article.
 +
 
 +
[[Category:Templates]]
 
</noinclude>
 
</noinclude>

Latest revision as of 11:41, 12 May 2018



Usage Produces
{{VT | planet = Kerbin | alt = 0}}
100.1288989294

This template calculates terminal velocity of an object given the planet and the altitude from the planet's surface. It uses {{Body data}} with the properties mass, radius, pressure and scale height.

#/Name Optional Description Default
1 or planet No The celestial body
2 or alt No The altitude at which the terminal velocity should be calculated.
3 or round Yes Round to the given number of decimal places. Not set/Doesn't round

(M is the mass of the body, r is the body's radius, p0 is pressure at 0 m altitude (“sea level”), a is the altitude above sea level and H is the scale height)

The formula assumes that the coefficient of drag (d) is 0.2 and is used from the atmosphere article.