From f52f2ddba44d3976fe630cdef13dc5ba6c8d051c Mon Sep 17 00:00:00 2001 From: Matthew Maring <56924612+hayden2000@users.noreply.github.com> Date: Sun, 3 May 2020 11:02:46 -0400 Subject: [PATCH] Fix nasal error --- Nasal/FMGC/FMGC.nas | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Nasal/FMGC/FMGC.nas b/Nasal/FMGC/FMGC.nas index 8a071448..b44bccad 100644 --- a/Nasal/FMGC/FMGC.nas +++ b/Nasal/FMGC/FMGC.nas @@ -214,9 +214,8 @@ var updateFuel = func { # Calculate trip fuel if (getprop("/FMGC/internal/tofrom-set") and getprop("/FMGC/internal/cruise-lvl-set") and getprop("/FMGC/internal/cruise-temp-set")) { crz = getprop("/FMGC/internal/cruise-fl"); - temp = getprop("/FMGC/internal/cruise-temp-set"); - isa = 15 - (2 * num(crz) / 10); - dist = flightPlanController.arrivalDist + (0.03306933933 * (temp - isa) * flightPlanController.arrivalDist); + temp = getprop("/FMGC/internal/cruise-temp"); + dist = flightPlanController.arrivalDist + (0.03306933933 * (temp - 15 + (2 * crz / 10)) * flightPlanController.arrivalDist); trip_fuel = 400.3 + (dist * -53.99) + (dist * dist * -0.07322) + (dist * dist * dist * 0.00001091) + (dist * dist * dist * dist * 0.00000000002962) + (dist * dist * dist * dist * dist * -0.0000000000001178) + (dist * dist * dist * dist * dist * dist * 0.000000000000000006322) + (crz * 53.87) + (dist * crz * 1.583) + (dist * dist * crz * 0.0007695) + (dist * dist * dist * crz * -0.0000001057) + (dist * dist * dist * dist * crz * 0.000000000001138) + (dist * dist * dist * dist * dist * crz * 0.0000000000000001736) + (crz * crz * -1.171) + (dist * crz * crz * -0.01219) + (dist * dist * crz * crz * -0.000002879) + (dist * dist * dist * crz * crz * 0.0000000003115) + (dist * dist * dist * dist * crz * crz * -0.000000000000004093) + (crz * crz * crz * 0.009160) + (dist * crz * crz * crz * 0.00004311) + (dist * dist * crz * crz * crz * 0.000000004532) + (dist * dist * dist * crz * crz * crz * -0.0000000000002879) + (crz * crz * crz * crz * -0.00003338) + (dist * crz * crz * crz * crz * -0.00000007340) + (dist * dist * crz * crz * crz * crz * -0.000000000002494) + (crz * crz * crz * crz * crz * 0.00000005849) + (dist * crz * crz * crz * crz * crz * 0.00000000004898) + (crz * crz * crz * crz * crz * crz * -0.00000000003999); setprop("/FMGC/internal/trip-fuel", trip_fuel / 1000); } else {