I was trying to obtain the same result of a differential equation with to different methods the first one is based on DSolve
and the second one is based on NDSolve
a = Around[1, 0.1];
b := DSolve[{y'[x] + y[x] == a, y[0] == a}, y[x], {x, 0, 1090}]
f[x_] = y[x] /. b[[1]];
f[2]
And with this code I get that $f[2]=1\pm 0.1018$.
Now I want to get the same result but using NDSolve
:
soli = NDSolve[{p'[x] + p[x] == a, p[0] == a}, p[x], {x, 0, 1090}]
solie[x_] = p[x] /. soli[[1]];
solie[2]
But the Mathematica V.12 gives as result
NDSolve::ndinnt: Initial condition 1.00±0.10 is not a number or a rectangular array of numbers.
The problem is that I need to use NDSolve
because I have a complicated differential equation (not the equation that appears in the example)
ParametricNDSolve[]
could help with this). Of course, you're not guaranteed to capture the full range of the trajectories, but I don't thinkNDSolve
is programmed to do it either. $\endgroup$Around[..]
. $\endgroup$