I am having trouble using NonlinearModelFit to fit to data generated by the equation I am trying to fit to.
test = Table[{x, ((Sqrt[3] + Sqrt[x + 3])^2)^(2/3) -
Sqrt[3 ((Sqrt[3] + Sqrt[x + 3])^2)^(1/3)] -
((Sqrt[3] + Sqrt[3])^2)^(2/3) -
Sqrt[3 ((Sqrt[3] + Sqrt[3])^2)^(1/3)] + 5},
{x, -3, 5, .1}
]
Here is the data I generated with the equation.
Blah = ListPlot[test]

This is what it looks like
nlm = NonlinearModelFit[
test, ((Sqrt[y] + Sqrt[F + y])^2)^(2/3) -
Sqrt[y ((Sqrt[y] + Sqrt[F + y])^2)^(1/
3)] - ((Sqrt[y] + Sqrt[y])^2)^(2/3) -
Sqrt[y ((Sqrt[y] + Sqrt[y])^2)^(1/3)], {y}, F]
My attempt to fit. The error says there are imaginary numbers yet there are none.
NonlinearModelFittries negativey. Try addingy>0as a constraint. You might also useAbs[y]in the expression. – george2079 Nov 18 '15 at 17:42y>=3) – george2079 Nov 18 '15 at 17:45F >= 3, surely? – Michael Seifert Nov 18 '15 at 17:59F+y>=0whereFhas a min value of-3from the data. ( his choice of variables is a bit confusing,yis the fit parameterFis the independent data value) – george2079 Nov 18 '15 at 18:03