-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
25458e0
commit e530d73
Showing
5 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |