Hello Bill (and Damodaran),
your last fit-result is quite impressive, but for me it seems to be the case that the parameters a, b, c of the function a y^2 + b y + c are quite different from those of the original function. Therefore, even giving a fit to the data, they are not what was looked for.
The original function was
f0 = (((Sqrt [a^2 + 8 a y] - a) (b - c))/(4 y)) + c
Now the square root often is a source of difficulties and so I prefer to "switch" variables
In[3]:= f1 = y /. Solve[x == f0, y][[1, 1]]
Out[3]= (a (b^2 - b c - b x + c x))/(2 (c - x)^2)
Here we have the original data, in which I reverse the variables as well
data = {{171.29, 6}, {171.63, 12.1}, {171.86, 24.2}, {172.06, 48.3}};
In[5]:= datax = Reverse /@ data
Out[5]= {{6, 171.29}, {12.1, 171.63}, {24.2, 171.86}, {48.3, 172.06}}
Now I construct a set of (almost polynomial) equations (without any roots!)
In[6]:= eqs = #[[1]] == f1 /. x -> #[[2]] & /@ data
Out[6]= {171.29 == (a (-6 b + b^2 + 6 c - b c))/(2 (-6 + c)^2),
171.63 == (a (-12.1 b + b^2 + 12.1 c - b c))/(2 (-12.1 + c)^2),
171.86 == (a (-24.2 b + b^2 + 24.2 c - b c))/(2 (-24.2 + c)^2),
172.06 == (a (-48.3 b + b^2 + 48.3 c - b c))/(2 (-48.3 + c)^2)}
Here I have 4 equations for 3 unknowns. To get start-Parameters for FindFit I drop in turn one of the equations and solve for a, b, c. This indeed gives 8 solutions:
In[20]:= TT = Table[Solve[Drop[eqs, {j, j}], {a, b, c}], {j, 1, 4}]
Out[20]= {{{a -> -1376.5, b -> -363.753,
c -> -779.312}, {a -> -1376.48, b -> 398.136,
c -> 747.409}}, {{a -> -1376.63, b -> 298.276,
c -> 553.491}, {a -> -1376.52, b -> -263.594,
c -> -571.99}}, {{a -> -1378.17, b -> 219.027,
c -> 402.152}, {a -> -1377.44, b -> -188.469,
c -> -413.064}}, {{a -> -1374.94, b -> 155.522,
c -> 288.652}, {a -> -1374.89, b -> -136.055, c -> -295.49}}}
Note that the a's are quite similar (and negative! I did not look in the case what happens if we take the negative square-root in the original function), while the b's and c's vary considerably and even change sign.
Now I prepare these results for FindFit
In[9]:= candidates = Flatten[TT, 1] /. Rule -> List
Out[9]= {{{a, -1376.5}, {b, -363.753}, {c, -779.312}}, {{a, \
-1376.48}, {b, 398.136}, {c, 747.409}}, {{a, -1376.63}, {b,
298.276}, {c,
553.491}}, {{a, -1376.52}, {b, -263.594}, {c, -571.99}}, {{a, \
-1378.17}, {b, 219.027}, {c,
402.152}}, {{a, -1377.44}, {b, -188.469}, {c, -413.064}}, {{a, \
-1374.94}, {b, 155.522}, {c,
288.652}}, {{a, -1374.89}, {b, -136.055}, {c, -295.49}}}
and then I should look in turn to FindFit for all candidates. Here for example number 3
In[24]:= sol2 =
FindFit[datax, f1, candidates[[3]], x, MaxIterations -> 1000]
Out[24]= {a -> -1376.7, b -> 292.629, c -> 543.659}
which gives the following results for the modified Problem and for the original function.
In[25]:= Plot[f1 /. sol2, {x, 0, 50}, Epilog -> {Red, Point /@ datax}]
Plot[f0 /. sol2, {y, 171.25, 172.25}, Epilog -> {Red, PointSize[.015], Point /@ data}, PlotRange -> {5, 50}]
Of course we should have a look at all candidates
FindFit[datax, f1, #, x, MaxIterations -> 1000] & /@ candidates
and get
{{a -> -1376.56, b -> -253.241, c -> -548.992}, {a -> -1376.7,
b -> 292.629, c -> 543.659}, {a -> -1376.7, b -> 292.629,
c -> 543.659}, {a -> -1376.56, b -> -253.241,
c -> -548.992}, {a -> -1376.7, b -> 292.629,
c -> 543.659}, {a -> -1376.56, b -> -253.241,
c -> -548.992}, {a -> -1376.7, b -> 292.629,
c -> 543.659}, {a -> -1376.56, b -> -253.241, c -> -548.992}}
and we see a is always negative in the order 1376, b has basically 2 values - 253 and 292 and that is the case with c too: - 548 and 543.
It remains to look for (physical ?) reasons which parameters are appropriate or which will give rise to perhaps negative expressions in the square-root.
Kind regards
Hans
Attachments: