hi:
I wrote a code to solve an ODE using Runge-Kutta 4th order, but unfortunately it doesn't work properly.
i need your help please:
clc;
clear all;
% initial values
gamma = 1.4;
P1 = 101325; % Pa
T1 = 298; % K
Rho1 = 1.225; % kg/m3
tol = -(1e-6); % convergence criteria for Vtheta
Vtheta0 = -10; % fake value to initiate the while loop
delta_theta = 0.5; % angle marching
% inputs
M1 = input('Free stream Mach number=');
theta_c = input('cone angle in degree=');
theta_s = input('initial guess for shock angle in degree=');
while (Vtheta0 <= -tol) || (Vtheta0 >= tol)
% checking the correct input for beta
if (theta_s <= asind(1/M1))
theta_c = 0.0;
Mc = M1;
disp(' !!!!! theta_s > theta_s_max !!!!! ');
return;
end
Comments
Leave a comment