Effacer les filtres
Effacer les filtres

Area Mach Number Relation

5 vues (au cours des 30 derniers jours)
Steven Castrillon
Steven Castrillon le 30 Sep 2019
I need to plot Mach number (M) as a function of Area ratios (A/A*) for subsonic and supersonic cases. I am trying to use newton-raphson method to iterate and find a converging solution for Mach number (M) at specific area ratios (A/A*), however i would like to be able to call in an array of A/A* inputs. The values for this array would from 0.1 to 10 (or 0.1:0.1:10) .
The function in question is
@(M) (1/M^2)*(((2+gm1*M^2)/gp1)^(gp1/gm1))-ARatio^2;
the variables for this function are;
g = 1.4;
gm1 = g-1;
gp1 = g+1;
Any help would be greatly appreciated!!!

Réponses (1)

darova
darova le 30 Sep 2019
Here is what i reached using polyxpoly
g = 1.4;
gm1 = g-1;
gp1 = g+1;
F = @(M) 1./M.^2.*((2+gm1*M.^2)/gp1).^(gp1/gm1);%-ARatio^2;
M = linspace(0.1,3.5); % Mach number
A = sqrt( F(M) ); % A ratio
plot(M,A) % draw function
hold on
% find Mach number of each A
for a = linspace(0.1,5,10)
mm = [0 4]; % just horizontal line
aa = [a a];
[xm,ya] = polyxpoly(mm,aa,M,A);
plot(xm,ya,'.-r')
end
hold off
  5 commentaires
darova
darova le 30 Sep 2019
I like it
Steven Castrillon
Steven Castrillon le 30 Sep 2019
yes but can you please help me to introduce an array of values for ARatio?
in the code i provided, ARatio is set as : ARatio = 1.5
when i set it as: ARatio = [0.1:0.1:10] i get an error at
Error in AREAMACH2 (line 62)
if (fj*fjp1 > 0)
Please help

Connectez-vous pour commenter.

Produits


Version

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by