# Why do I keep getting these error messages?

I am trying to fit a parametric differential equation system to the data of the infection cases in Hungary. I keep getting the error messages:

ParametricNDSolveValue::ndcf: Repeated convergence test failure at t == 56.47422376827764; unable to continue.

FindFit::sszero: 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 wrote this code:

infected = {0, 2, 4, 4, 5, 7, 9, 12, 13, 15, 18, 30, 36, 47, 55, 70,
74, 92, 109, 138, 157, 195, 223, 256, 298, 361, 447, 492, 525, 585,
623, 678, 733, 744, 817, 895, 980, 1190, 1310, 1410, 1458, 1512,
1579, 1652, 1763, 1834, 1916, 1984, 2098, 2168, 2284};
infectedTime = Table[{i, infected[[i]]}, {i, 1, Length[infected]}];

Clear[a, b, c, d];
model = ParametricNDSolveValue[{active[t] ==
sum[t] - recovered[t] - deceased[t],
sum'[t] == a active[t] (1 - 1/b sum[t]),
recovered'[t] == c* active[t],
deceased'[t] == d*active[t],
sum[0] == 1, active[0] == 1, recovered[0] == 0, deceased[0] == 0},
active,
{t, 0, 150}, {a, b, c, d}]
fit = FindFit[infectedTime,
model[a, b, c, d][t], {{a, 1}, {b, 5000}, {c}, {d}}, t,
WorkingPrecision -> 25]

Plot[model[a, b, c, d][t] /. fit, {t, 0, 150}, PlotRange -> All,
PlotStyle -> Blue, PlotLabel -> Style["Curve of the infection"],
FrameLabel -> {Style["Days"], Style["Actice cases"]}]



The meaning of the functions and parameters: Functions:

• active cases: active[t] = sum[t]-recovered[t]-deceased[t]
• all cases (Logistic model): d/dtsum[t] = a active[t](1- 1/b sum[t])
• recovery: d/dt recvored[t] = c active[t]
• decease: d/dt deceased[t] = d active[t]

Parameters: - a: Spread of the infection - b: Maximal value of the infected - c: Recovery rate - d: Mortality rate

Can you help to solve the problem, please? I thank you in advance!

• At a glance, I can point out that the components passed to a solver should do their computations at a precision least as great as the working precision of the solver. In this case, your ParametricNDSolve works at MachinePrecision, which is less than FindRoot[..., WorkingPrecision -> 25]`. Apr 23 '20 at 16:50
• Please write an informative title—one that relates specifically to your question, and isn't applicable to millions of other questions. Apr 23 '20 at 17:09