I'm trying to extract 4 parameters by fitting one set of data with an ODE via NonlinearModelFit. I originally thought the process should be straightforward, but later on I found I was totally wrong.
The data shown below has a sigmoidal curve:
data={{0,0},{49.7775,0.0229687},{99.555,0.0675156},{149.333,0.124518},{199.11,0.190047},{248.888,0.261029},{298.665,0.334263},{348.443,0.406511},{398.22,0.474956},{447.998,0.537032},{497.775,0.591725},{547.553,0.639402},{597.33,0.680795},{647.108,0.717289},{696.885,0.749756},{746.663,0.77867},{796.44,0.804481},{846.218,0.827329},{895.995,0.847812},{945.773,0.866318},{995.55,0.883013},{1045.33,0.897972},{1095.11,0.911227},{1144.88,0.92315},{1194.66,0.933717},{1244.44,0.943222},{1294.22,0.951594},{1343.99,0.958822},{1393.77,0.965246},{1443.55,0.970854},{1493.33,0.975964},{1543.1,0.98057},{1592.88,0.984747},{1642.66,0.988132},{1692.44,0.991107},{1742.21,0.993695},{1791.99,0.995825},{1841.77,0.997373},{1891.55,0.998711},{1941.32,0.999723},{1991.1,1}};
The model with 4 target parameters (n, m, Ea, LogZ) is below:
model65[n_?NumberQ,m_?NumberQ,Ea_?NumberQ,LogZ_?NumberQ]:=Module[{α,t},First[α /.NDSolve[{α'[t] == ((10^LogZ)/60) Exp[-Ea/(8.314 (65 + 273.15))] α[t]^m (1 - α[t])^n, α[0] == 0}, α, {t, 0, 2400}]]]
Using NonLinearModelFit to extract n, m ,Ea, LogZ (with initial guesses):
fit = NonlinearModelFit[data,model[n, m, Ea, LogZ][t], {{n, 1.5}, {m, 0.5},{Ea, 85000}, {LogZ, 10}}, t];
fit["BestFitParameters"]
Below is the error message I'm having:
NonlinearModelFit::fmgz: Encountered a gradient that is effectively zero. The result returned may not be a minimum; it may be a maximum or a saddle point. >>
Can anyone please help me with this problem? Thank you in advance for the great help!
ParametricNDSolve
$\endgroup$