필터 지우기
필터 지우기

Mathematical formula calculation problem in Matlab

조회 수: 2 (최근 30일)
Ahmet Akcura
Ahmet Akcura 2021년 7월 12일
댓글: Simon Chan 2021년 7월 12일
I need to write above equation to my Matlab code but while writing it I got comfused. (M0=1.695) , (tetha1= 41.31 degree), and (gamma=1.4) . When I insert that numbers our result M1=2.5476. but it should be around 1.51. Would you please write that code in Matlab? I will insert my code also;
M1= sqrt((2.4^2*M0^4*(sind(t1)^2)-4*(M0^2*(sind(t1)^2)-1)*(1.4*M0^2*(sind(t1)^2)+1))/((2*1.4*M0^2*(sind(t1)^2)-2.4)*(0.4*M0^2*(sind(t1)^2)+2)));

답변 (1개)

Simon Chan
Simon Chan 2021년 7월 12일
If you accept more than 1 line:
Gamma = 1.4;
M0 = 1.695;
theta1 = 41.31;
Msin = (M0*sind(theta1))^2;
Gplus = Gamma + 1;
Gminus = Gamma - 1;
nominator = (Gplus^2*Msin^2)-4*(Msin-1)*(Gamma*Msin+1);
denominator = (2*Gamma*Msin-Gplus)*(Gminus*Msin+2);
M1 = sqrt(nominator/denominator)
  댓글 수: 3
Ahmet Akcura
Ahmet Akcura 2021년 7월 12일
nominator = (Gplus^2*Msin^2)-4*(Msin-1)*(Gamma*Msin+1);
in above part 'Msin^2' please control this term. Not true. When I write like you with arranging correctly, it gave me the M1=2.54 again.
Simon Chan
Simon Chan 2021년 7월 12일
You are right, but I accidentally got what you want in my previous code.
Anyway, I got 2.5476 when change the nominator to the following:
nominator = (Gplus^2*M0^2*Msin)-4*(Msin-1)*(Gamma*Msin+1);

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Gamma Functions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by