Numerical multidimensional integration over function of six variables

In summary, the conversation is about a programming problem involving integrating a function with six variables over a 10-sided 6-cube of points. The person is considering using Monte Carlo integration and is seeking advice on how to implement it in higher dimensions. They are also considering using a discretized method but are concerned about the time it would take to compute. Some suggestions are given, including revealing the function being integrated and checking out resources on the Monte Carlo method.
  • #1
WraithM
32
0
So, I'm writing a program in matlab. I have a function of six variables, say f(x1,x2,x3,x4,x5,x6). I want to integrate over x4, x5, and x6 numerically. f is defined over a 10 sided 6-cube of points. I also want to integrate over the whole cube.

So I want,

[tex]F(x_1, x_2, x_3) = \int\int\int f(x_1, x_2, x_3, x_4, x_5, x_6) dx_4 dx_5 dx_6[/tex]

Does anybody have a hint to get me started down some path? I'm really stuck. It's sort of an insane problem.

The internet seems to point me toward monte carlo integration. These methods handle multidimensional integrals well apparently. Can monte carlo methods handle my problem of not integrating over all 6 dimensions? I don't know why I think monte carlo wouldn't, but if so, does anybody have an idea of how to do this? I'm not an expert in numerical integration at all. I'm also not opposed to turning this project into a C program or Mathematica or something. Anything that will solve the problem would be much appreciated!
 
Physics news on Phys.org
  • #2
In what form do you have f? Is it an analytic function that could be integrated analytically? Or is it a numeric table? In either case, why can't you just discretize the function, multiply by the volume element dx4 dx5 dx6 and add up the contribution from all of the little cubes? You would basically be evaluating the sum:
[tex]\sum_{x4_{min}}^{x4^{max}}\sum_{x5_{min}}^{x5^{max}}\sum_{x6_{min}}^{x6^{max}}f(x1,x2,x3,x4,x5,x6)\Delta x4 \Delta x5 \Delta x6[/tex]
 
  • #3
For 3 or more dimensions, Monte Carlo is faster than straightforward method (suggested by phyzguy).
 
  • #4
Thank you for the replies!

I have it stored in a 6D array. I've considered the way that phyzguy suggested. It seems that method would take a very long time. I've got a grid of a 10^6 points on it, but this method would be extremely easy to implement. It'd be like 5 - 6 lines of code in Matlab, tops. It would not scale well with size at all... If I make the size of the 6-cube larger by even 1, the time the problem would take goes up tremendously. It goes up as O(N^d). Where N is the size of one side of the cube, and d is the dimension. If I can't figure out monte carlo integration, I will definitely do this, but I want to avoid this method if at all possible.

Mathman, do you have any suggestions on how to implement the monte carlo integration? I have only a rough idea of what monte carlo integration even is, let alone how to implement it in higher dimensions. Could you give me a rough outline of what my algorithm should look like? Your description may be very rough.

If not, do you have a suggestion on a website, already implemented package, or book where I could learn how to do this?

Thank you again!
 
Last edited:
  • #5
WraithM,

You're not doing an entirely numerical calculation since some of the variables remain as variables. It's best if you reveal the specific function that you are integrating so you can get advice about how to handle the symbolic part of the calculation.
 

1. What is numerical multidimensional integration over a function of six variables?

Numerical multidimensional integration over a function of six variables is a mathematical process used to calculate the definite integral of a function with six independent variables. It involves breaking down the multidimensional space into smaller regions and approximating the integral within each region using numerical methods.

2. Why is numerical multidimensional integration necessary for functions with six variables?

Numerical multidimensional integration is necessary for functions with six variables because it is often not possible to solve these integrals analytically. Numerical methods provide a way to approximate the integral and obtain a numerical solution.

3. What are some common numerical methods used for multidimensional integration?

Some common numerical methods used for multidimensional integration include Monte Carlo integration, Gaussian quadrature, and adaptive quadrature. These methods use different approaches to approximate the integral and can provide different levels of accuracy.

4. How accurate are numerical methods for multidimensional integration?

The accuracy of numerical methods for multidimensional integration depends on the specific method used, the number of regions used for approximation, and the complexity of the integrand. In general, the more regions used and the smaller the regions, the more accurate the approximation will be.

5. Can numerical multidimensional integration be used for functions with a higher number of variables?

Yes, numerical multidimensional integration can be used for functions with a higher number of variables. However, as the number of variables increases, the complexity of the integral and the time required for computation also increase. Therefore, more efficient and specialized numerical methods may be needed for higher dimensional integrals.

Similar threads

Replies
1
Views
1K
Replies
15
Views
2K
Replies
3
Views
1K
Replies
3
Views
415
  • Programming and Computer Science
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
13
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
7
Views
1K
Replies
19
Views
3K
  • Programming and Computer Science
Replies
1
Views
735
Back
Top