My code does not work
조회 수: 1 (최근 30일)
이전 댓글 표시
%Input parameters
Tt = 3000; %Kelvin
Pt = 1500; %[kPa]
mfr = 10; %[kg/s]
R = 8.314;
cp = 2;
cv = 2;
v_idex = sqrt(2*9.8*R*Tt);
[T_e, p_e, rho_e] = IdealGas(Tt, pt, v_e, mfr);
gamma = cp/cv;
%method of chracteristic calculation
M = zeros(1,100);
T = zeros(1,100);
rho = zeros(1,100);
v = zeros(1,100);
p = zeros(1,100);
%plot M
plot(x, M);
xlabel('x');
ylabel('M');
%plot pressure
plot(x, pt);
xlabel('x');
ylabel('p (kPa)');
%plot Temp
plot(x, T);
xlabel('x');
ylabel('T Kelvin');
%plot density_rho
plot(x, rho);
xlabel('x');
ylabel('rho');
%plot velocity magnitude
plot(x, v_idex )
xlabel('x');
ylabel('velocity magnitude (m/s)');
댓글 수: 1
답변 (1개)
Sulaymon Eshkabilov
2023년 1월 21일
Note also that there is one more undefined input vars in your function call. v_e is undefined, v_idex is computed from the given variables, R, Tt.
%Input parameters
Tt = 3000; %Kelvin
Pt = 1500; %[kPa]
mfr = 10; %[kg/s]
R = 8.314;
cp = 2;
cv = 2;
v_idex = sqrt(2*9.8*R*Tt); % v_idex is known
[T_e, p_e, rho_e] = IdealGas(Tt, pt, v_e, mfr);
%%% v_e = ?
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!