about summary refs log tree commit diff
path: root/src/engine.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine.py')
-rw-r--r--src/engine.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/engine.py b/src/engine.py
new file mode 100644
index 0000000..f1da646
--- /dev/null
+++ b/src/engine.py
@@ -0,0 +1,14 @@
+import fuel
+
+class Engine():
+    def __init__(self, name: str, isp: int, max_flow_rate: int):
+        self.name = name
+        self.max_flow_rate = max_flow_rate
+        self.isp = isp
+
+    def thrust(self, throttle: int, g: float):
+        #https://www.grc.nasa.gov/www/k-12/airplane/specimp.html
+        return self.flow_rate(throttle) * self.isp * g
+
+    def flow_rate(self, throttle: int):
+        return self.max_flow_rate * (throttle / 100)
\ No newline at end of file