How can I solve those questions ?

11 vues (au cours des 30 derniers jours)
m ksuu
m ksuu le 31 Oct 2014
Commenté : Star Strider le 1 Nov 2014
how can I sovle those questions :
Q1: Use the least square methods to find the most suitable equation for fitting the following data:
I(min): 1.02 ,0.84 ,0.69 ,0.56 ,0.38 ,0.17
CA(Ibmole/ft)): 1.5 ,2.0 ,2.5 ,3.0 ,4.0, 6.0
Test the following equation to decide which one will fit with small error:
The error = Σ(CA - CAexp )^2
1. CA = CAo exp(-kl)
2. CA= CAo I^K
3. 1/CA= CAo+ I^K
Note: CA0 and K are the equation constants (slope and intercept depends on equation in the liner mode)
,..,.,..,...,...,..,....,....,......,......,.....,....,.....,.....,.....,....,.....,.....,
Q2:
a) Use Antoine Equations to fit the following data: Antoine Equation :
In (p*)=A- B/C+T
T(C): 30 50 100 150 200 250
p(atm): 0.042 0.122 1.00 4.70 15.36 39.22
b) calculate the pressure at temperature of 400 K ?
that's it i hope you help me and thank you

Réponses (2)

Matt J
Matt J le 31 Oct 2014
Useful commands: lsqcurvefit (if you have it), fminsearch (if you don't)
  1 commentaire
m ksuu
m ksuu le 1 Nov 2014
Thank you very much Mr.Matt J for you help appreciate that but I need some details..

Connectez-vous pour commenter.


Star Strider
Star Strider le 1 Nov 2014
The Antoine Equation is easy:
% % % Antoine Equation
% % % log10(p) = A - B/(C + T)
pm = @(b,T) 10.^(b(1) - b(2)./(b(3)+T)); % Objective Function
T = [30 50 100 150 200 250];
p = [0.042 0.122 1.00 4.70 15.36 39.22];
Cost = @(b) sum((p - pm(b,T)).^2); % Sum-Of-Squares Cost Function
[b, fv] = fminsearch(Cost, [3 5 7]');
p400 = pm(b,400); % Get Pressure At T = 400°C
I took the base-10 antilog of the equation because the Wikipedia article on the Antoine equation describes it as being a base-10 log. You can keep it as a log if you like, but you will need to rewrite the equation and do the appropriate data transformation.
  2 commentaires
m ksuu
m ksuu le 1 Nov 2014
Thank you Thank you Mr. Star Strider you're life saver but can you post it in order and also question number one I need solution for it , hint anything you could help me with
Star Strider
Star Strider le 1 Nov 2014
My pleasure!
This should provide you with everything you need to answer Question #1. You just need to adapted the code.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Problem-Based Optimization Setup dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by