zzzbbx
zzzbbx

Reputation: 10141

evaluating multiple integrals

Is there any library to evaluate multidimensional integrals? I have at least 4 (in general much more than that), where the integrand is a combination of variables, so I cannot separate them. Do you know of any library for numerical evaluation? I'm especially looking for either matlab or c++, but I will use anything that will do the work.

Upvotes: 2

Views: 2193

Answers (4)

jmbr
jmbr

Reputation: 3348

Since you don't specify the kind of integrals or the actual dimensionality, I can only suggest that you take into account that

$\int_A \int_B f(x, y) \, \mathrm{d} x \, \mathrm{d} y = \int_A F(x) \, \mathrm{d} x$

where the function F(x) is defined as

$x \mapsto F(x) = \int_B f(x, y) \, \mathrm{d} y$

and use this fact to compute your integrals with the usual quadrature techniques. For example, you could use trapz or quad in MATLAB. However, if the dimensionality is truly high, then you are better off using Monte Carlo algorithms.

Upvotes: 3

duffymo
duffymo

Reputation: 308938

"Numerical Recipes In C" has a very nice chapter on numerical integration.

Maybe Gaussian quadrature can help you out.

Upvotes: 1

edgarmtze
edgarmtze

Reputation: 25058

Yes there is TESTPACK which is C++ program which demonstrates the testing of a routine for multidimensional integration.

Upvotes: 0

Dhaivat Pandya
Dhaivat Pandya

Reputation: 6536

First link off google.

Seems pretty roboust.

Upvotes: 2

Related Questions