How to do interval algorithms based integration using "IntervalArithmetic" package in Julia?

83 views Asked by At

How to integrate an interval-algorithm-based nonlinear function (for example, d(F(X))/dX= a/(1+cX), where a=[1, 2], c=[2, 3] are interval constants) using the "IntervalArithmetic" package in Julia? Could you please give an example? Or could you please provide a relevant document? F(X) will come out as an interval with bounds, F(X)=[p, q].

1

There are 1 answers

2
Mikael Öhman On

Just numerical integration? As long as the integrating code is written in Julia (otherwise i suspect it will struggle to understand IntervalArithmetic) and there isn't some snag about how it should interpret tolerances, then it should just work, more or less how you might expect it to handle e.g. complex numbers.

using IntervalArithmetic
f(x) = interval(1,2)/(1+interval(2,3)*x)

and combined with e.g.

using QuadGK
quadgk(f, 0, 1)

gives ([0.462098, 1.09862], [0, 0.636515]) (so.. i guess here the interpretation is that the error is in the interval 0 to 0.636515 :))

Just as a sanity check, lets just go with a good old trapezodial rule.

using Trapz

xs = range(0, 1,length=100)
trapz(xs, f.(xs))

again gives us the expected interval [0.462098, 1.09862]