From c6d4f3b0ff33b72427f8e099de6077b1a8f2812a Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Mon, 24 Aug 2009 17:53:57 +0200 Subject: [PATCH] Fix to LaRCsim interpolation code Is this code still used? I don't know, but -Wall -Werror turned up a problem. --- src/FDM/LaRCsim/IO360.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FDM/LaRCsim/IO360.cxx b/src/FDM/LaRCsim/IO360.cxx index 3b1090090..00acb23e6 100644 --- a/src/FDM/LaRCsim/IO360.cxx +++ b/src/FDM/LaRCsim/IO360.cxx @@ -376,8 +376,8 @@ float FGNewEngine::Power_Mixture_Correlation(float thi_actual) } if((i == 0) && (AFR_actual < AFR[i])) { // Assume linear extrapolation of the slope between the first two points for points before the first point - dydx = (mixPerPow[i] - mixPerPow[i-1]) / (AFR[i] - AFR[i-1]); - mixPerPow_actual = mixPerPow[i] + dydx * (AFR_actual - AFR[i]); + dydx = (mixPerPow[1] - mixPerPow[0]) / (AFR[1] - AFR[0]); + mixPerPow_actual = mixPerPow[0] + dydx * (AFR_actual - AFR[0]); return mixPerPow_actual; } if(AFR_actual == AFR[i]) { -- 2.39.5