Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
junzis
GitHub Repository: junzis/openap
Path: blob/master/scripts/fuel_flow_correction_factor.py
592 views
1
import numpy as np
2
import pandas as pd
3
import matplotlib.pyplot as plt
4
from openap import aero
5
6
df = pd.read_fwf('db/engines.txt')
7
df1 = df.query('cruise_sfc>0').copy()
8
9
df1['sealevel_sfc'] = (df1.fuel_c3 + df1.fuel_c2 + df1.fuel_c1) / (df1.max_thrust / 1000)
10
11
df1['fuel_ch'] = (df1.cruise_sfc - df1.sealevel_sfc) / (df1.cruise_alt * aero.ft)
12
13
factor = df1.fuel_ch
14
print(np.mean(factor))
15
print('fuel flow altitude correction factor', np.mean(factor))
16
17
plt.scatter(np.arange(len(factor)), factor)
18
plt.ylim([factor.min(), factor.max()])
19
plt.show()
20
21