I am trying to fit my data, and I keep having error messages as below. Could anybody help me to solve this problem? The codes are written after the error messages.
Oo = 3;
R = 8.314;
Wo = 15999;
Wh = 18001.8;
MW = 317127.7;
k1eqn[T_, dSox_, dHox_] = E^((-dHox + dSox (T + 273))/(R (T + 273)));
k2eqn[T_, dShyd_, dHhyd_] = E^((-dHhyd + dShyd (T + 273))/(
R (T + 273)));
This link is for the code of FullDataSet to fit. I couldn't add the dataset code as it's a lot of data. You can copy and paste the code in the link.
This is my fitting eqn. I know that I should use [[3,1,2]] or [[4,1,2]].
FullTestK1[ph2o_, po2_, k1_, k2_] := NSolve[Eliminate[
k1 == (p^2*Oo)/( po2^(1/2)* vo) &&
k2 == oh^2/(ph2o vo Oo ) &&
delM == ((Wo*(0.1 - vo)/MW) + (Wh*oh/(2*MW)))*100 &&
2 vo + oh + p == 0.2,
{p, vo, oh}], delM][[3, 1, 2]]
Fullfit =
FindFit[FullDataSet, {FullTestK1[ph2o, po2, k1eqn[T, dSox, dHox],
k2eqn[T, dShyd,
dHhyd]]}, {{dHox, -100000}, {dSox, -100}, {dHhyd, -100000},{dShyd, -100}}, {ph2o, po2, T}]
After I use FindFit, I keep having errors.
Eliminate
with[[3,1,2]]
give the desired result? In other words, is the order of the results produced byEliminate
always what you want? $\endgroup$