Find the best fit with some conditions
I'm not sure why FindFit
can't manage it, but if I construct the objective function myself to minimize square residuals and I use Method -> "DifferentialEvolution"
then I get the answer:
objective = Total[(#[[2]] - b[#[[1]]])^2 & /@ data];
fit = Last[NMinimize[{objective, conds}, {l, j, s},
Method -> "DifferentialEvolution"]]//Chop
(* result: {l -> 0, j -> 1.5, s -> 1.5} *)
However, using FindFit
's Method->NMinimize
I was unable to achieve the above result.