I would like to solve numerically an equation which involves a numerical function constructed by fitting some data:
data := {{0, 1}, {1, 1}, {.2, 3}, {.4, 5}, {.6, 2}};
try[x_?NumberQ, y_?NumberQ] := (auy = y;
solution = FindFit[data, A (aux - auy) + B Exp[aux - auy], {A, B}, aux];
myFit[aux_?NumberQ] = (A (aux - auy) + B Exp[aux - auy]) /.
solution; Return[myFit[x]])
NSolve[y - try[1, y] == 0, y]
I tried with this code but it does not function (various errors). Does anyone know how to help me?
thank you in advance!
try[1, y]
? does not return anything? This is really strange that no body seems to do any testing of anything any more. $\endgroup$try[1,2]
and it works.try[1,y]
has not to return an output since it need numerical parameters to work. What I want is a way to solve the problem I described, i.e. using NSolve to solve the equation which involve a function numerically determined by a fit. My code obviously does not work, that's why I asked help. Does anyone knows how to solve my issue? I hope I clarified my post! $\endgroup$