-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOB_shockangle.m
More file actions
30 lines (21 loc) · 764 Bytes
/
OB_shockangle.m
File metadata and controls
30 lines (21 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
function [beta] = OB_shockangle(M,theta)
%This function will give a shock wave angle (beta) for user input Theta and
%upstream Mach Number M1. The function assumes that the specific heat ratio
%is 1.4 and the weak solution is required. If the specific heat is not air
%or the strong solutions is required "WaveAngle_Calculator.m" must be used.
%OB_shockangle(M1,theta)
g=1.4;
delta=1;
T=theta*(pi/180); %converts theta to radians.
a=(g-1)/2;
b=(g+1)/2;
c=(g+1)/4;
lamda=((M^2-1)^2-3*(1+(a)*(M)^2)*(1+(b)*(M)^2)*tan(T)*tan(T))^0.5;
num1=(M^2-1)^3-9*(1+(a)*(M)^2)*(1+(a)*(M)^2+(c)*(M)^4)*tan(T)*tan(T);
den1=(lamda)^3;
X1=num1/den1;
num2=(M)^2-1+2*lamda*cos((4*pi*delta+acos(X1))/3);
den2=3*(1+(a)*(M)^2)*tan(T);
X2=num2/den2;
beta=atan(X2)*(180/pi);
end