# I have to write a code with using these formulas. (Gama=1.4 M1=3.4) Then I have to reach p02/p01~= 1. So beta in the code should be changable. At the end M2 will also found

4 views (last 30 days)
Eda Deniz Soydinc on 8 Jun 2022
Commented: Eda Deniz Soydinc on 13 Jun 2022
##### 0 CommentsShowHide -1 older comments

Sign in to comment.

### Accepted Answer

Torsten on 10 Jun 2022
Edited: Torsten on 10 Jun 2022
fun = @(beta,p02divp01,M1,gamma)p02divp01-((gamma+1)*M1.^2.*sin(beta).^2./...
(2+(gamma-1)*M1.^2.*sin(beta).^2)).^(gamma/(gamma-1)).*...
((gamma+1)./(2*gamma*M1.^2.*sin(beta).^2-(gamma-1))).^1/(gamma-1);
p02divp01 = 1.0;
M1 = 3.4;
gamma = 1.4;
beta0 = pi/4;
beta = fzero(@(beta)fun(beta,p02divp01,M1,gamma),beta0);
beta_degree = beta*180/pi
beta_degree = 13.1745
theta = atan(2*cot(beta).*M1.^2.*sin(beta).^2./(M1.^2.*(gamma+cos(2*beta))+2.0));
theta_degree = theta*180/pi
theta_degree = 10.1904
M2 = sqrt((2+(gamma-1)*M1.^2.*sin(beta).^2)./...
((2.0*gamma*M1.^2.*sin(beta).^2-(gamma-1)).*sin(beta-theta).^2))
M2 = 25.3984
##### 3 CommentsShowHide 2 older comments
Eda Deniz Soydinc on 13 Jun 2022
Understood. Thanks.

Sign in to comment.

### Categories

Find more on Gas Dynamics in Help Center and File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by