Skip to content
Snippets Groups Projects
Commit 9d0cd8a5 authored by Marco Luigi Gaibotti's avatar Marco Luigi Gaibotti
Browse files

[alpha-phi] Added test directly with Coeficient

parent 6d5984ea
No related branches found
No related tags found
1 merge request!19Draft: Implementation of Alpha phi
Pipeline #11400 failed
Subproject commit bc61b5b9265bde0f30dfc53db0bf5820e3c69b04 Subproject commit 1bc8c371f3852dab849aa6db901c8f275dfe025f
...@@ -23,6 +23,8 @@ interpolant = griddedInterpolant(... ...@@ -23,6 +23,8 @@ interpolant = griddedInterpolant(...
%% Validate in multiple cases coefficients by n*section %% Validate in multiple cases coefficients by n*section
% uncomment * if manually outputting err from Coefficient
n = 100; n = 100;
mach = rand(n, 1); mach = rand(n, 1);
...@@ -32,11 +34,16 @@ sections = ap.geometry.nPanel; ...@@ -32,11 +34,16 @@ sections = ap.geometry.nPanel;
% Generic alpha-phi % Generic alpha-phi
alpha = rand(n, 1)*20; alpha = rand(n, 1)*20;
phi = rand(n, 1)*360; phi = rand(n, 1)*360;
beta = rand(n, 1)*20 - 10;
err1 = nan(6, n); err1 = nan(6, n);
altitude = rand(n, 1)*3000;
for i = 1:n for i = 1:n
[coeffsR, coeffs] = computeCoeffs(sections, alpha(i), mach(i), phi(i), abk(i), interpolant); [coeffsR, coeffs] = computeCoeffs(sections, alpha(i), mach(i), phi(i), abk(i), interpolant);
err1(:, i) = abs(coeffs - coeffsR); 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 end
% Extrapolation (best near) % Extrapolation (best near)
...@@ -46,6 +53,7 @@ phi = 247; ...@@ -46,6 +53,7 @@ phi = 247;
abk = 1.3; % This should actually never happen abk = 1.3; % This should actually never happen
[coeffsR, coeffs] = computeCoeffs(sections, alpha, mach, phi, abk, interpolant); [coeffsR, coeffs] = computeCoeffs(sections, alpha, mach, phi, abk, interpolant);
err2 = abs(coeffs - coeffsR); err2 = abs(coeffs - coeffsR);
% Edge cases (phi = 120*n) % Edge cases (phi = 120*n)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment