1
$\begingroup$

I am trying to fit my experiment data to the equation but I have a problem as below. Could somebody can help me with this? I would really appreciate it!

R = 8.3145;
dH1 = -143683;
dS1 = -186.036;
dG1[T_] = dH1 - (T + 273) dS1;
keq1[T_] = E^(-dG1[T]/(R (T + 273)));
S = 0.2;

This is my data that I want to fit.

solveair = {{650., 0.0929321}, {625., 0.0916715}, {600., 0.090182}, {575., 
  0.0882618}, {550., 0.0850123}, {525., 0.0823273}, {500., 
  0.0781639}, {475., 0.0694796}, {450., 0.0457255}, {425., 
  0.0328606}, {400., 0.0221124}}

And this is the fitting code I used and had a problem.

airfit = FindFit[solveair, 
  1/24 (E^((-dH1 + dS1 (T + 273))/(R (T + 273))) Sqrt[po2] + 12 S - 
     Sqrt[(E^((-dH1 + dS1 (T + 273))/(R (T + 273))))^2 po2 + 
      24 E^((-dH1 + dS1 (T + 273))/(R (T + 273))) Sqrt[po2]
        S]), {po2}, {T}]

Thanks in advance!

$\endgroup$

1 Answer 1

1
$\begingroup$

It seems to me like your fitting function does converge with the default setting to a negative value which produces imaginary values in the end (because of 'SQRT[po2]'). I changed the starting point for po2 to 0.01 which then gives a positive value.

airfit = FindFit[solveair,1/24*(E^((-dH1 + dS1*(T + 273))/(R*(T + 273)))*Sqrt[po2] + 12*S-Sqrt[(E^((-dH1 + dS1*(T + 273))/(R*(T + 273))))^2 po2 + 
   24 E^((-dH1 + dS1*(T + 273))/(R*(T + 273)))*
    Sqrt[po2] S]), *{{po2, 0.01}}*, T]

With that you get:

{po2 -> 0.0150501}

Fitted Function

Hope this is what you need!

$\endgroup$
1
  • $\begingroup$ Yay! this is what I wanted to get. Thank you so much! $\endgroup$
    – Yewon Shin
    Sep 30, 2020 at 18:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.