Variable range gives a wrong answer
Show older comments
Greetings everyone, I have the following code, and my issue with it is that when I use a range of Pc from 400 to 600 then my mdot at 400 is 0.0002383 but it has to be as in mdotc equation = 0.0001987. There is a significant difference. Any idea why?
Equations with extra c is check equations which gives the right answer and equations below are those where I tried to use a range from 400 to 600.
Any help woud be useful. :)
clc; clear all; close all
%Variables
g=5/3;
g1=(g-1)/2;
g2=(1-g)/2;
Ac=1.267*10^-4;
Pc=400:600; % Pc range from 400 to 600
Pcc= 400; %Variable check
T0=350;
P0=615;
Rg=207.85;
Tcc = T0*(Pcc/P0)^((g-1)/g)-1 %Check at Pcc=400
mc= sqrt((1/g1)*((P0/Pcc)^((g-1)/g)-1))%Check at Pcc=400
mdotc = (Pcc/(sqrt(Tcc))*mc*sqrt(g/Rg)*Ac)%Check at Pcc=400
Tc = T0*(Pc/P0).^((g-1)/g)-1;
m = sqrt((1/g1)*((P0./Pc).^((g-1)/g)-1));
mdot = (Pc/(sqrt(Tc))*m*sqrt(g/Rg)*Ac);
plot(Pc,mdot)
xlabel('Background Pressure (Pc)')
ylabel('Mass flow rate (kg/s)')
Accepted Answer
More Answers (0)
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!