about summary refs log tree commit diff
path: root/src/engine.py
blob: f1da646d9626bb0b80b51a5c58904af37ac464a0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
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)