My code does not work
Ältere Kommentare anzeigen
%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 Kommentar
Stephen23
am 20 Jan. 2023
Pt % what you defined
pt % what you used
Note the capitalisation.
Antworten (1)
Sulaymon Eshkabilov
am 21 Jan. 2023
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 = ?
Kategorien
Mehr zu Scatter Plots finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!