I am trying to use this model for later use in FindFit:
model[x0_?NumberQ, r_?NumberQ, k_?NumberQ, n_?NumberQ] := model[x0, r, k, n] =
First[x /. NDSolve[{x'[t] == r x[t] (1 - x[t]/k)^n, x[0] == x0}, x, {t, 0, 61}]]
Assume now that those parameters are sought within the following ranges:
x0: 10^-50..10^-10;
n: 0.1..5.0;
r: 1..10;
k: 1..1000.
Depending on the specific choice of the parameter combination I will get various NDSolve numeric errors. So what would be a good choice of MachinePrecision, AccuracyGoal and PrecisionGoal that would work for that parameter space?
n >= 1, the optionsPrecisionGoal -> 10, AccuracyGoal -> Infinity, WorkingPrecision -> 100seem to take care of everything I tried. AWorkingPrecisionaround100seems to be needed forx0as small as10^-50-- the smallerx0, the greater the precision needed. Second, I think forn < 1,xreacheskin finite time. I haven't figured out a graceful way to stop the integration at the right time. Alson = 1.01behaves liken < 1-- not sure why exactly. – Michael E2 Oct 08 '14 at 02:57NDSolve::precwcan be ignored. Ideally you would pass parametersx0,r,k, andnwith a precision at least as great as theWorkingPrecision-- then you should not get the message. – Michael E2 Oct 08 '14 at 02:59