Skip to content

Commit

Permalink
Version 1 of fuel system
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmaring committed May 26, 2020
1 parent 25458e0 commit e530d73
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 0 deletions.
Binary file added alternate-fuel-performance.xlsx
Binary file not shown.
Binary file added extra-fuel-performance.xlsx
Binary file not shown.
Binary file added final-fuel-performance.xlsx
Binary file not shown.
Binary file added fuel-performance.xlsx
Binary file not shown.
26 changes: 26 additions & 0 deletions fuel.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#
# fuel.R
# Copyright © 2020 Matthew Maring
#
# Fuel calculations for the Airbus A320 file
# Please see ReadMe for details
#

# read the csv file, pick according to type of calucaltion you want to perform
fuel <- read.csv(file=file.choose())

# regular fuel, calculates:
# - fuel usage
# - fuel correction for weight
# - trip time
lm(fuel$Fuel.Usage ~ polym(fuel$Air.Distance, fuel$Flight.Level, degree=6, raw=TRUE))
lm(fuel$Fuel.Correction ~ polym(fuel$Air.Distance, fuel$Flight.Level, degree=5, raw=TRUE))
lm(fuel$Time ~ polym(fuel$Air.Distance, fuel$Flight.Level, degree=6, raw=TRUE))

# get time if have fuel
# must plug-in fuel without correction
lm(fuel$Fuel.Usage ~ polym(fuel$Time, degree=12, raw=TRUE))

# get fuel if have time
lm(fuel$Fuel.Usage ~ polym(fuel$Time, fuel$Air.Distance, fuel$Flight.Level, degree=6, raw=TRUE))
lm(fuel$Fuel.Correction ~ polym(fuel$Time, fuel$Air.Distance, fuel$Flight.Level, degree=5, raw=TRUE))

0 comments on commit e530d73

Please sign in to comment.