Double integration over infinite intervals in Fortran

In summary, the conversation discusses a problem with a double integration where one of the integration limits is infinity. The speaker is aware that quadpack (qagi) can handle integration over infinite intervals, but is unsure how to make it work for double integration. They are also seeking information on other routines that can handle both double integration and integration over infinite intervals. The other person suggests developing a custom integration routine, and provides suggestions for handling integrals over ##[0,\infty]##. They also mention the need for more specific information about the problem in order to provide further assistance.
  • #1
Monika Randhawa
2
0
Hi.. I am stuck up with a double integration where one of the integration limit is infinity. I know quadpack (qagi) can handle integration over infinite intervals. But how to make it work for the double integration. Or if there is any other routine that can handle both double integration and integration over infinite intervals. Thanks...
 
Technology news on Phys.org
  • #2
It would likely help if you could post the integral or give an indication of its nastiness. The possible answers may depend on that.
 
  • #3
Monika Randhawa said:
Hi.. I am stuck up with a double integration where one of the integration limit is infinity. I know quadpack (qagi) can handle integration over infinite intervals. But how to make it work for the double integration. Or if there is any other routine that can handle both double integration and integration over infinite intervals. Thanks...

I don't know about any Fortran library having this. However, I believe that unless your integral is very difficult, e.g. having singularities, the best option is to develop your own integration routine. This is not difficult if you have some experience in Fortran programming. In this way you can also adapt the routine to your needs.
Essentially, for an integration over ##[0,\infty]## you have to cases:
Let's call the variable with infinite limit ##x##.
1) if the integrand decays exponentially to 0 as ##x\rightarrow \infty##, you should use a Gauss-Laguerre rule
2) if the integrand decays more slowly than exponentially to 0 as ##x\rightarrow \infty##, the best option is usually to use a mapping to ##[0,1]## and then a Gauss-Legendre rule

I cannot give you more specific information without knowing the problem in more detail.
 
  • #4
Thanks... Let me try this.
 

1. How can I perform double integration over infinite intervals in Fortran?

To perform double integration over infinite intervals in Fortran, you can use the quadpack library. This library contains functions such as dqags and dqagi which allow for integration over infinite intervals.

2. Can I use any other libraries or functions for double integration over infinite intervals in Fortran?

Yes, you can also use the gsl_integration library from the GNU Scientific Library (GSL). This library provides efficient and accurate numerical integration routines, including gsl_integration_qags for integration over infinite intervals.

3. How do I specify the integration limits for infinite intervals in Fortran?

For infinite intervals, you can use the predefined constants GSL_INFINITY and GSL_NEGINFINITY from the gsl_integration library. These constants can be passed as the lower and upper limits of integration.

4. Are there any special considerations when using double integration over infinite intervals in Fortran?

Yes, it is important to handle potential singularities in the integrand carefully. This can be done by using the dqagse or gsl_integration_qagp functions, which allow for specifying the location of singularities and handling them accordingly.

5. Can I use double integration over infinite intervals in Fortran for multidimensional integration?

Yes, both the quadpack and gsl_integration libraries support multidimensional integration over infinite intervals. You can specify the integration limits for each dimension using the appropriate functions, such as dqagse for quadpack and gsl_integration_qags for gsl_integration.

Similar threads

  • Programming and Computer Science
Replies
7
Views
1K
  • Programming and Computer Science
Replies
19
Views
2K
  • Programming and Computer Science
Replies
6
Views
5K
  • Programming and Computer Science
Replies
1
Views
612
  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
8
Views
3K
  • Calculus and Beyond Homework Help
Replies
9
Views
791
  • Programming and Computer Science
Replies
3
Views
1K
  • Advanced Physics Homework Help
Replies
8
Views
115
Replies
1
Views
793
Back
Top