Meyer-G function in Python and scipy

I need the Meijer G function in scipy. I read somewhere on the internet that due to its generality, the Meier G function is not supported as a special function in scipy, but everyone should write something according to their personal use case.

My problem is that I have no experience with complex integration. Since LaTeX is prohibited here, here is what I am trying to solve numerically:

enter image description here

(the first line is the general case, the second line is my case which I am trying to compute), with p (a), k, k2 given

As wikipedia states , there are three ways to get L

:

  • L runs from -iāˆž to + iāˆž, so that all poles of Ī“ (bj-s), j = 1, 2, ..., m, are to the right of the path, and all poles of Ī“ (1 - ak + s) , k = 1, 2, ..., n, are on the left.
  • L is a cycle starting and ending at + āˆž, covering all poles of Ī“ (bj - s), j = 1, 2, ..., m, exactly once in the negative direction, but not surrounding any pole of Ī“ (1 - ak + s), k = 1, 2, ..., n.
  • L is a cycle that starts and ends at -āˆž and covers all poles of Ī“ (1 - ak + s), k = 1, 2, ..., n, exactly once in the positive direction, but not surrounding the pole Ī“ (bj - s), j = 1, 2, ..., m.

How do I get L

and solve the integral? The way I'm used to calculating integrals over real numbers is

import numpy as np
myL = np.linspace(0, 1, 100)
densityL = myL[1] - myL[0]
myIntegral = (F(myL)*densityL).sum()

      

I'm not too sure about the efficiency, I would prefer a simple and slow working example that I can use to understand the methodology.

+3


source to share


1 answer


For anything tricky, I really think you should avoid evaluating the integral itself, especially if you don't have experience with complex integration and use a well-tested existing implementation.



Meyer's function is implemented in mpmath and possibly Sympy .

+3


source







All Articles