Numerical multidimensional integration over function of six variables

Click For Summary

Discussion Overview

The discussion revolves around the numerical integration of a six-variable function, specifically focusing on integrating over three of those variables while keeping the others fixed. Participants explore methods for achieving this integration, particularly through Monte Carlo techniques and discretization approaches.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant seeks guidance on integrating a function of six variables numerically, specifically over three of those variables, and expresses uncertainty about the feasibility of Monte Carlo methods for this purpose.
  • Another participant suggests discretizing the function and summing contributions from small cubes, questioning the need for Monte Carlo methods.
  • A third participant notes that Monte Carlo methods are generally faster for multidimensional integrals compared to straightforward summation methods.
  • The original poster mentions having the function stored in a 6D array and expresses concerns about the scalability of the suggested discretization method, indicating a preference for Monte Carlo integration if feasible.
  • One participant advises revealing the specific function to receive tailored advice regarding the symbolic aspects of the integration.
  • A later reply points to Wikipedia as a resource for learning about the Monte Carlo method.

Areas of Agreement / Disagreement

Participants have not reached a consensus on the best method for integration. There are competing views on whether to use Monte Carlo integration or a discretization approach, and the discussion remains unresolved regarding the most efficient technique.

Contextual Notes

Participants express concerns about the computational complexity of the discretization method, particularly its scaling with the size of the cube and the number of dimensions involved. There is also uncertainty regarding the specifics of the function being integrated, which may affect the choice of method.

Who May Find This Useful

This discussion may be useful for individuals interested in numerical integration techniques, particularly in high-dimensional spaces, and those exploring the application of Monte Carlo methods in computational problems.

WraithM
Messages
32
Reaction score
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
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]
 
For 3 or more dimensions, Monte Carlo is faster than straightforward method (suggested by phyzguy).
 
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:
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.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 19 ·
Replies
19
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K