The following piece of code
SetDirectory[NotebookDirectory[]];
f[r_] := Tanh[100*(r - 3/10)] + Tanh[100*(4/10 - r)]
Plot[f[x], {x, 0, 1}]
s = NDSolve[{y'[x] == D[f[x], x],
y[1] == f[1]}, {y}, {x, -1/1000000000, 1},
Method -> "ExplicitRungeKutta", WorkingPrecision -> 100,
AccuracyGoal -> 30, PrecisionGoal -> 30, InterpolationOrder -> All,
MaxSteps -> 10^6, StartingStepSize -> 10^-8]
data = Table[
Flatten@{N[x, 40], N[y[x] /. s, 40],
N[f[x] - (y[x] /. s), 40]}, {x, N[0/10, 100], N[10/10, 100],
N[1/100, 100]}];
Export["known_solution_test.txt", data, "TSV"];
reproduces numerically the known solution f[r_]
within $30$ decimal digits, as seen in known_solution_test.txt
.
However the following warning pops-up
N::meprec: Internal precision limit $MaxExtraPrecision = 50.` reached while evaluating {-Tanh[60]+Tanh[70]}.
Is it something I should take into consideration? Or how can I fix it?
$MaxExtreaPrecision
? There's some advice in the docs. $\endgroup$