about summary refs log tree commit diff
path: root/atmosphere.py
diff options
context:
space:
mode:
Diffstat (limited to 'atmosphere.py')
-rw-r--r--atmosphere.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/atmosphere.py b/atmosphere.py
new file mode 100644
index 0000000..48f9bd1
--- /dev/null
+++ b/atmosphere.py
@@ -0,0 +1,14 @@
+import math
+
+class Atmosphere():
+    def __init__(self, avg_sea_level_pressure: int, molar_mass_air: float, standard_temp: float):
+        self.avg_sea_level_pressure = avg_sea_level_pressure
+        self.molar_mass_air = molar_mass_air
+        self.standard_temp = standard_temp
+
+    #https://math24.net/barometric-formula.html
+    def density_at_height(self, height: int, g: float) -> None:
+        R = 8.3144598 #universal gas constant
+        pressure = self.avg_sea_level_pressure * math.e ** (-(self.molar_mass_air * g * height)/(R * self.standard_temp))
+        density = pressure / (R * 10000)
+        return density
\ No newline at end of file