Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How can I run multiple bisect programs in one file?

1 回表示 (過去 30 日間)
Aaron
Aaron 2014 年 4 月 7 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I have created bisection function files (five) and would like to combine them into one file to run. Below are the first 3.
File 1:
function f = enth2(T)
% For phi=0.2
HR=-249400; % Total enthalpy of reactants.
hO2 = 31.999*(1.507.*(T-298) - 33.54.*(sqrt(T)-sqrt(298)) + 111.1.*log(T/298));
hN2 = 28.013*(1.450.*(T-298) - 287.9.*log(T/298) + (5.35e4).*((1/298)-(1./T)));
hCO2 = 44.01*(1.540.*(T-298) - 245.1.*log(T/298) + (4.13e4).*((1/298)-(1./T)));
hH2O = 18.015*(4.613.*(T-298) - 206.6.*(sqrt(T)-sqrt(298)) + 967.5.*log(T/298));
HP = -6595306+11*(hH2O)+10*(hCO2)+62*(hO2)+291.4*(hN2);
f=HR-HP;
end
File 2:
function f = enth3(T)
% For phi=0.4.
HR=-249400; % Total enthalpy of reactants.
hO2 = 31.999*(1.507.*(T-298) - 33.54.*(sqrt(T)-sqrt(298)) + 111.1.*log(T/298));
hN2 = 28.013*(1.450.*(T-298) - 287.9.*log(T/298) + (5.35e4).*((1/298)-(1./T)));
hCO2 = 44.01*(1.540.*(T-298) - 245.1.*log(T/298) + (4.13e4).*((1/298)-(1./T)));
hH2O = 18.015*(4.613.*(T-298) - 206.6.*(sqrt(T)-sqrt(298)) + 967.5.*log(T/298));
HP = -6595306+11.*(hH2O)+10.*(hCO2)+23.25.*(hO2)+145.7.*(hN2);
f = HR-HP;
end
File 3:
function f = enth4(T)
% For phi=0.6
HR=-249400; % Total enthalpy of reactants.
hO2 = 31.999*(1.507.*(T-298) - 33.54.*(sqrt(T)-sqrt(298)) + 111.1.*log(T/298));
hN2 = 28.013*(1.450.*(T-298) - 287.9.*log(T/298) + (5.35e4).*((1/298)-(1./T)));
hCO2 = 44.01*(1.540.*(T-298) - 245.1.*log(T/298) + (4.13e4).*((1/298)-(1./T)));
hH2O = 18.015*(4.613.*(T-298) - 206.6.*(sqrt(T)-sqrt(298)) + 967.5.*log(T/298));
f=HR-(-6595306+11.*(hH2O)+10.*(hCO2)+10.33.*(hO2)+97.13.*(hN2));
end
  1 件のコメント
Jan
Jan 2014 年 4 月 7 日
What do you want to achieve by this combination? We cannot guess this important detail.

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by