My code does not work
古いコメントを表示
%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 件のコメント
Stephen23
2023 年 1 月 20 日
Pt % what you defined
pt % what you used
Note the capitalisation.
回答 (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 = ?
カテゴリ
ヘルプ センター および File Exchange で Scatter Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!