Skip to content
Snippets Groups Projects
Commit e6e250f2 authored by Lorenzo Bettonte's avatar Lorenzo Bettonte
Browse files

[alpha-phi] fixed a bug where n would in the wrong range (in Coefficient's...

[alpha-phi] fixed a bug where n would in the wrong range (in Coefficient's class)  and Handle AoA matrix usage in alphaTotPhi cases (in ballistic)
parent c9bfcf48
No related branches found
No related tags found
No related merge requests found
......@@ -131,7 +131,7 @@ classdef Coefficient
coefficients(1:6) = obj.staticInterpolant(alphaTot, mach, psi, altitude, airbakes); % Get coeffs in limited range
if n > 1 % If necessary, perform rotation on different frame
if n > 0 % If necessary, perform rotation on different frame
R = [cos(deltaPhi), -sin(deltaPhi);
sin(deltaPhi), cos(deltaPhi)];
......
......@@ -134,7 +134,7 @@ end
if not(abs(ur) < 1e-9 || velsNorm < 1e-9)
alpha = atan(wr/ur);
beta = atan(vr/ur); % beta = asin(vr/V_norm) is the classical notation, Datcom uses this one though.
% alpha_tot = atan(sqrt(wr^2 + vr^2)/ur); % datcom 97' definition
alphaTot = atan(sqrt(wr^2 + vr^2)/ur); % datcom 97' definition
else
alpha = 0;
beta = 0;
......@@ -144,14 +144,17 @@ alphaOut = alpha;
betaOut = beta;
%% INTERPOLATE AERODYNAMIC COEFFICIENTS:
if abs(alpha) > rocket.coefficients.state.alphas(end)*pi/180 || ...
abs(beta) > rocket.coefficients.state.betas(end)*pi/180
if rocket.coefficients.type == CoeffType.AlphaBeta
if abs(alpha) > rocket.coefficients.state.alphas(end)*pi/180 || abs(beta) > rocket.coefficients.state.betas(end)*pi/180
coeffsValues = rocket.coefficientsHighAOA.get(alpha, mach, beta, absoluteAltitude, extension, xcg);
end
elseif abs(alphaTot) > rocket.coefficients.state.alphas(end)*pi/180
coeffsValues = rocket.coefficientsHighAOA.get(alpha, mach, beta, absoluteAltitude, extension, xcg);
else
coeffsValues = rocket.coefficients.get(alpha, mach, beta, absoluteAltitude, extension, xcg);
end
% Retrieve Coefficients
CA = coeffsValues(1); CY = coeffsValues(2); CN = coeffsValues(3);
Cl = coeffsValues(4); Cm = coeffsValues(5); Cn = coeffsValues(6);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment