Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Help with numerical integration

  1. Dec 30, 2015 #1

    DrDu

    User Avatar
    Science Advisor

    I want to integrate a function numerically from 0 to infinity where for small x ##f(x)\sim x^{-5/2} \exp(-a/x)## and for large x ##f(x) \sim \exp(-bx)##.
    How do I best treat the steep rise for small x?
     
  2. jcsd
  3. Dec 30, 2015 #2

    Krylov

    User Avatar
    Science Advisor
    Education Advisor

    The integrand is not singular at ##x = 0## so you could use a standard routine for adaptive quadrature, as implemented in the standard software (Maple, Mathematica, MATLAB, Octave, etc.). This will select a smaller mesh width near ##x = 0## and allow for a larger mesh width for large ##x##.

    If you insist on doing it yourself, it is not so hard to implement one of the usual rules (e.g. trapezoidal or Simpson's) adaptively through recursion. Most NA books discuss this. If you need references, let me know. To deal with the limit at infinity, just restrict to a large but finite interval. Because of your behavior for large ##x##, it will be easy to get a bound on the contribution to the error.
     
  4. Dec 31, 2015 #3

    DrDu

    User Avatar
    Science Advisor

    Thank you for your answer Krylov!
    Adaptive quadrature is too slow for my purposes as I will have to evaluate integrals of this kind many thousand times. I think now about splitting the integral e.g. at x=1, use y=-a/x as new integration variable for x<1 and use Gauss-Laguerre integration on both regions.
     
  5. Dec 31, 2015 #4

    BvU

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Steep is associated with googling "gear method of integration" in my perception.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Help with numerical integration
  1. Numerical Integration (Replies: 1)

  2. Numerical integration (Replies: 2)

Loading...