# FindFit;;nrlnum problem

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}]


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}


Hope this is what you need!

• Yay! this is what I wanted to get. Thank you so much! – user72564 Sep 30 '20 at 18:01