How to Numerically Solve a Multiple Integral in Mathematica or Sage?

Click For Summary

Discussion Overview

The discussion revolves around the numerical solution of a multiple integral involving exponential functions and a potential that depends on positions and velocities. Participants seek guidance on how to implement this in Mathematica or Sage software, with a focus on the integration process and the necessary context for the variables involved.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant presents a multiple integral to be solved numerically, but lacks clarity on the bounds and variable definitions.
  • Another participant emphasizes the need for more context to understand the integration problem, pointing out the absence of specified bounds and variable identifications.
  • A later reply clarifies that the integral is intended to calculate the second virial coefficient for particles in a square, providing the bounds for integration.
  • Some participants suggest that numerical integration can be approached iteratively, using techniques applicable to single integrals for nested ones, while also noting the potential need for numeric expressions for certain variables.
  • One participant acknowledges a lack of experience with the software but suggests setting constants to 1 to simplify initial calculations.
  • Another participant corrects their earlier omission by defining the relative position and velocity needed for the integration.

Areas of Agreement / Disagreement

Participants express differing views on the sufficiency of the provided information for numerical integration, with some agreeing that more context is needed while others offer suggestions based on their understanding of numerical methods.

Contextual Notes

The discussion highlights limitations in the initial problem statement, particularly regarding the specification of integration bounds and the definitions of variables involved in the integral.

Korbid
Messages
15
Reaction score
0
I'm trying to solve numerically this multiple integral. But i don't know how to calculate it with Mathamtica or Sage software.

$$\int{e^{-(\vec{v}^2_1+\vec{v}^2_2)}e^{-E(\tau)}}d\vec{r}_1d\vec{r}_2d\vec{v}_1d\vec{v}_2$$
$$E(\tau)=\frac{k}{\tau^2}e^{-\tau/\tau_0}$$
$$\tau(\vec{r}_{12};\vec{v}_{12})=\frac{b-\sqrt{b^2-ac}}{a}$$
$$a=||\vec{v}_{12}||$$
$$b=\vec{r}_{12}\cdot\vec{v}_{12}$$
$$c=||\vec{r}_{12}|| - (2R)^2$$

Thank you!
 
Physics news on Phys.org
Korbid said:
I'm trying to solve numerically this multiple integral. But i don't know how to calculate it with Mathamtica or Sage software.

$$\int{e^{-(\vec{v}^2_1+\vec{v}^2_2)}e^{-E(\tau)}}d\vec{r}_1d\vec{r}_2d\vec{v}_1d\vec{v}_2$$
$$E(\tau)=\frac{k}{\tau^2}e^{-\tau/\tau_0}$$
$$\tau(\vec{r}_{12};\vec{v}_{12})=\frac{b-\sqrt{b^2-ac}}{a}$$
$$a=||\vec{v}_{12}||$$
$$b=\vec{r}_{12}\cdot\vec{v}_{12}$$
$$c=||\vec{r}_{12}|| - (2R)^2$$

Thank you!
What you have presented is insufficient. The bounds of the integration are not apparently specified, nor are the variables identified in any way.

Much more context is needed to understand what you want to do.
 
SteamKing said:
What you have presented is insufficient. The bounds of the integration are not apparently specified, nor are the variables identified in any way.

Much more context is needed to understand what you want to do.

I'm trying to calculate the second virial coefficient for a potential E that depends on positions and velocities. The N particles are moving inside LxL square.

$$\int^L_0\int^L_0\int^{\infty}_0\int^{\infty}_0{e^{-(\vec{v}^2_1+\vec{v}^2_2)}e^{-E(\tau)}}d\vec{r}_1d\vec{r}_2d\vec{v}_1d\vec{v}_2$$
$$E(\tau)=\frac{k}{\tau^2}e^{-\tau/\tau_0}$$
$$\tau(\vec{r}_{12};\vec{v}_{12})=\frac{b-\sqrt{b^2-ac}}{a}$$
$$a=||\vec{v}_{12}||$$
$$b=\vec{r}_{12}\cdot\vec{v}_{12}$$
$$c=||\vec{r}_{12}|| - (2R)^2$$

R, tau_0 and k are constants.
 
I don't have much experience using Mathematica or Sage. But most numerical integration algorithms use iteration to solve such problems anyway, so as long as you know how to calculate a single integral with one of those programs you can use the same technique to calculate 4 nested ones. Just evaluate the integrals from the inside out, and feed the result of the first to the second, from the second to the third, and so on. If the constants give you trouble, just set them all to 1 to start with. (There might be a function supplied that is designed for doing an arbitrary number of integrations as well, so look for that.)

Also, you said you want to numerically integrate these equations, but the information you've provided is only really sufficient for a symbolic integration. For example, how would the software evaluate b without numeric expressions for r12 and v12?
 
kreil said:
I don't have much experience using Mathematica or Sage. But most numerical integration algorithms use iteration to solve such problems anyway, so as long as you know how to calculate a single integral with one of those programs you can use the same technique to calculate 4 nested ones. Just evaluate the integrals from the inside out, and feed the result of the first to the second, from the second to the third, and so on. If the constants give you trouble, just set them all to 1 to start with. (There might be a function supplied that is designed for doing an arbitrary number of integrations as well, so look for that.)

Also, you said you want to numerically integrate these equations, but the information you've provided is only really sufficient for a symbolic integration. For example, how would the software evaluate b without numeric expressions for r12 and v12?

I'm sorry, i forgot it.
r12 is the relative position and v12 is the relative velocity
$$ r_{12}=r_1-r_2$$
it's the same for v12
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
3
Views
1K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
2
Views
1K
  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 0 ·
Replies
0
Views
1K