I am trying to fit some experimental data to a Van der Pol oscillator model, solving the differential equation and using FindFit (like in the examples given in the Wolfram Documentation) like this:
model[\[Mu]_?NumberQ,r_?NumberQ,a_?NumberQ,b_?NumberQ,c_?NumberQ,d_?NumberQ,
f_?NumberQ]:=(model[\[Mu],r,a,b,c,d,f]=First[x/. NDSolve[{x''[t]-\[Mu]*(r-b*x[t]^2)*x'[t]+d*x[t]==f, x[0]==a, x'[0]==c},x,{t,0,15}]])
fit=FindFit[data,model[\[Mu],r,a,b,c,d,f][x],{{\[Mu],143},{r,0.26},{a,-0.04},{b,800},{c,0.7},{d,48},{f,-0.55}},x]
gpp=Plot[model[\[Mu],r,a,b,c,d,f][x]/.fit,{x,0,5},PlotStyle->Red];
Show[gp,gpp]
where gp is simply the ListLinePlot of my data. I struggled a lot to find by hand some values for all the parameters in order to have already good overlap between the model and the data, because I know that the method above is quite sensitive to that. Anyway, when I input the parameters and run it, what eventually happens is that the method seems to work, optimising slightly the parameters and making the plot, BUT I always get the message:
FindFit: The step size in the search has become less than the tolerance prescribed by the PrecisionGoal option, but the gradient is larger than the tolerance specified by the AccuracyGoal option. There is a possibility that the method has stalled at a point that is not a local minimum.
I never understood what this means...Does it actually mean the fit didn't really work? How do I get rid of it and make sure the method I'm using is working??
Thanks, GIacomo
Show[ListPlot[data], gpp]
certainly suggests that it might have worked. Adding in that figure would be helpful. $\endgroup$