# Using Around with NDSolve

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)

• I think you might have to integrate each end-point value separately (ParametricNDSolve[] could help with this). Of course, you're not guaranteed to capture the full range of the trajectories, but I don't think NDSolve is programmed to do it either. – Michael E2 Feb 8 '20 at 22:45
• @Michael E2: The following soli = ParametricNDSolve[{p'[x] + p[x] == a, p[0] == a}, p, {x, 0, 1090}, {a}];p1 = p[Around[1, 0.1]] /. soli; p1[10] /. soli does not work for me in version 12.0 on Windows 10 32bit. – user64494 Feb 9 '20 at 17:38
• @user64494 Why would you think it would work? I said "end-point" (i.e. a number), not Around[..]. – Michael E2 Feb 9 '20 at 18:28
• @Michael E2: I tried that, no more and no less. – user64494 Feb 9 '20 at 18:38

You can use ParametricNDSolve to analyse how sensitive the solution is to parameters or initial conditions. There are multiple examples on the reference page under "Scope".