Hi I cannot figure out this from the documentation of this command. For example, take one of the examples in the documentation, where I also added initial guesses for the parameters.
data = {{6.47, 3.65}, {7.43,
3.45}, {3.9, -2.94}, {4.8, -1.29}, {2.48, -0.35}, {6.32,
3.16}, {2.59, -1.19}, {9.13, -2.}, {3.81, -3.04}, {3.33, -2.68}}; \
Clear[model];
model[a_?NumberQ, b_?NumberQ,
c_?NumberQ] := (model[a, b, c] =
Module[{y, x},
First[y /.
NDSolve[{y''[x] + a y[x] == 0, y[0] == b, y'[0] == c},
y, {x, 0, 10}]]])
nlm = NonlinearModelFit[data,
model[a, b, c][x], {{a, 1}, {b, 2}, {c, 2}}, x,
Method -> "Gradient"]; Show[ListPlot[data],
Plot[nlm[x], {x, 0, 10}, PlotStyle -> Orange]]
Next, suppose I want to change the initial guesses to constraints $a \in [1,1.5]$, etc . My first guess does not work
nlm1 = NonlinearModelFit[data,
model[a, b, c][x], {{a, 1,1.5}, {b, 2,2.5}, {c, 2,3}}, x,
Method -> "Gradient"];
NonlinearModelFit[data, {form, cons}, {β1, …}, {x1, …}]
.cons
are your constraints. It's the third headline example in the documentation. $\endgroup$