Skip to content

Commit

Permalink
Merge pull request #55 from PaulCreusy/53-increase-max-altitude-of-st…
Browse files Browse the repository at this point in the history
…andard-atmosphere

increase the maximum altitude of the standard atmosphere to 86km
  • Loading branch information
PaulCreusy authored Mar 9, 2025
2 parents d49e2fa + de6033d commit c75fd83
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
21 changes: 15 additions & 6 deletions flight_mech/atmosphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ class StandardAtmosphere(AtmosphereModel):
Notes
-----
For more details, see https://en.wikipedia.org/wiki/International_Standard_Atmosphere.
For more details, see: https://en.wikipedia.org/wiki/International_Standard_Atmosphere.
For the original paper, see: https://www.digitaldutch.com/atmoscalc/US_Standard_Atmosphere_1976.pdf.
"""

gamma = 1.4
Expand All @@ -175,11 +176,14 @@ def compute_temperature_from_altitude(z: float):
Air temperature in K.
"""

temperature = (288.15 + z * (216.65 - 288.15) / 11000) * (z < 11000) + \
temperature = (288.15 + z * -6.5 / 1000) * (z < 11000) + \
216.65 * (z >= 11000) * (z < 20000) + \
(216.65 + (z - 20000) * (228.65 - 216.65) / 12000) * (z >= 20000) * (z < 32000) + \
(228.65 + (z - 32000) * (270.65 - 228.65) / 12000) * \
(z >= 32000) * (z < 47000)
(216.65 + (z - 20000) * 1. / 1000) * (z >= 20000) * (z < 32000) + \
(228.65 + (z - 32000) * 2.8 / 1000) * \
(z >= 32000) * (z < 47000) + \
270.15 * (z >= 47000) * (z < 51000) + \
(270.15 + (z - 51000) * -2.8 / 1000) * (z >= 51000) * (z < 71000) + \
(214.15 + (z - 71000) * -2. / 1000) * (z >= 71000) * (z < 86000)

return temperature

Expand All @@ -203,7 +207,12 @@ def compute_pressure_from_altitude(z: float):
(22632 * np.exp(-157.77e-6 * (z - 11000))) * (z >= 11000) * (z < 20000) + \
(5474.9 * np.power(1 + 4.615e-6 * (z - 20000), 34.163)) * (z >= 20000) * (z < 32000) + \
(868.014 * np.power(1 + 12.245e-6 * (z - 32000), -12.2)) * \
(z >= 32000) * (z < 47000)
(z >= 32000) * (z < 47000) + \
(110.906 * np.exp(-126.293e-6 * (z - 47000))) * (z >= 47000) * (z < 51000) + \
(66.939 * np.power((270.65) / (270.65 - 2.8 * (z - 51000) / 1000), 12.2)) * \
(z >= 51000) * (z < 71000) + \
(3.9564 * np.power((214.65) / (214.65 - 2. * (z - 71000) / 1000), -17.09)) * \
(z >= 71000) * (z < 86000)

return pressure

Expand Down
2 changes: 1 addition & 1 deletion flight_mech/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ class EarthEnvironment:
Class to define the Earth's environment.
"""

g = 9.81 # m.s-2
g = 9.80665 # m.s-2

0 comments on commit c75fd83

Please sign in to comment.