I have following data:
data={{374.46707`, 0.665317421546049`}, {375.52396999999996`,
0.660664852164608`}, {376.58087`, 0.665317421546049`}, {377.63777`,
0.651359713401726`}, {378.69467`,
0.651359713401726`}, {379.75156999999996`,
0.637402005257403`}, {380.80859999999996`,
0.637402005257403`}, {381.8655`, 0.609486588968758`}, {382.9224`,
0.600181450205876`}, {383.97929999999997`,
0.56761346453579`}, {385.0362`, 0.507130062577058`}, {386.0931`,
0.407565077814223`}, {387.15, 0}};
and I am fitting following function:
nlm = NonlinearModelFit[data, {3/4 A (1 + Sqrt[1 - (8 ((x - B)+(x - B)^2))/(9(387.15 - B))]), 0.0 < A < 0.4, 387 < B < 387.15}, {{B,387}, {A, 0.306}}, x]
and I get an error, from which other errors follow:
NonlinearModelFit::nrnum: The function value -95.7402-17.0695 I is not a real number at {B,A} = {387.,0.306}.
What I am doing wrong?
B = 387
. Also the starting value you give isn't really in the range of values for which you've restrictedB
. I would remove the restriction onB
and use 395 as the starting value. $\endgroup$