From 9d0cd8a59f21125f21ce143c658115688d06cb17 Mon Sep 17 00:00:00 2001 From: Mauco03 <marco.gaibotti@skywarder.eu> Date: Sat, 26 Apr 2025 22:49:21 +0200 Subject: [PATCH] [alpha-phi] Added test directly with Coeficient --- common | 2 +- utils/tests/alphaPhi/testRotation.m | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/common b/common index bc61b5b9..1bc8c371 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit bc61b5b9265bde0f30dfc53db0bf5820e3c69b04 +Subproject commit 1bc8c371f3852dab849aa6db901c8f275dfe025f diff --git a/utils/tests/alphaPhi/testRotation.m b/utils/tests/alphaPhi/testRotation.m index 6f23ceed..98597289 100644 --- a/utils/tests/alphaPhi/testRotation.m +++ b/utils/tests/alphaPhi/testRotation.m @@ -23,6 +23,8 @@ interpolant = griddedInterpolant(... %% Validate in multiple cases coefficients by n*section +% uncomment * if manually outputting err from Coefficient + n = 100; mach = rand(n, 1); @@ -32,11 +34,16 @@ sections = ap.geometry.nPanel; % Generic alpha-phi alpha = rand(n, 1)*20; phi = rand(n, 1)*360; +beta = rand(n, 1)*20 - 10; err1 = nan(6, n); +altitude = rand(n, 1)*3000; for i = 1:n [coeffsR, coeffs] = computeCoeffs(sections, alpha(i), mach(i), phi(i), abk(i), interpolant); err1(:, i) = abs(coeffs - coeffsR); + + % uncomment if error calculation manually added internally + % [~, err1(:, i)] = ap.get(alpha(i)*pi/180, mach(i), beta(i)*pi/180, altitude(i), abk(i), 1.7); end % Extrapolation (best near) @@ -46,6 +53,7 @@ phi = 247; abk = 1.3; % This should actually never happen [coeffsR, coeffs] = computeCoeffs(sections, alpha, mach, phi, abk, interpolant); + err2 = abs(coeffs - coeffsR); % Edge cases (phi = 120*n) -- GitLab