Is it possible to use the bisection method?
Afficher commentaires plus anciens
I'm having a difficult time setting up my code.
Here is a quick rundown of what I'm trying to do: I have a set(4) of equations (we'll call them setA) that rely on a temperature, T. I also have another set (5) of equations (we'll call them setB) that also rely on T and phi (0.2:0.2:1.0).
I figured I could eliminate having to write a loop using the phi values and just put them in each of the setB equations. Below are the equations that I wrote:
hO2 = 1.507*(T-298) - 33.54*(sqrt(T)-sqrt(298)) + 111.1*log(T/298);
hN2 = 1.450*(T-298) - 287.9*log(T/298) + (5.35e4)*((1/298)-(1/T));
hCO2 = 1.540*(T-298) - 245.1*log(T/298) + (4.13e4)*((1/298)-(1/T));
hH2O = 4.613*(T-298) - 206.6*(sqrt(T)-sqrt(298)) + 967.5*log(T/298);
HR=-249400;
HP1= -6595306+11*(hH2O)+10*(hCO2)+62.00*(hO2)+294.1*(hN2); % phi=0.2
HP2= -6595306+11*(hH2O)+10*(hCO2)+23.25*(hO2)+145.7*(hN2); % phi=0.4
HP3= -6595306+11*(hH2O)+10*(hCO2)+10.33*(hO2)+97.13*(hN2); % phi=0.6
HP4= -6595306+11*(hH2O)+10*(hCO2)+3.875*(hO2)+72.85*(hN2); % phi=0.8
HP5= -6595306+11*(hH2O)+10*(hCO2)+0.000*(hO2)+58.28*(hN2); % phi=1.0
Now I wanted to use the bisect method to make the following statement true:
HR-HP=0
And I wanted to go through a range of 300:50000 values of T, to check this statement. Would I have to create a script for each of setB equations and bisect them individually? Or can I run one bisect program to find the temperature for each setB equation?
Thank you!
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Startup and Shutdown dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
