# meijerG

Meijer G-function

## Syntax

``meijerG(a,b,c,d,z)``

## Description

example

````meijerG(a,b,c,d,z)` returns the Meijer G-Function. `meijerG` is element-wise in `z`. The input parameters `a`, `b`, `c`, and `d` are vectors that can be empty, as in `meijerG([], [], 3.2, [], 1)`.```

## Examples

collapse all

```syms x meijerG(3, [], [], 2, 5)```
```ans = 25```

Call `meijerG` when `z` is an array. `meijerG` acts element-wise.

```a = 2; z = [1 2 3]; meijerG(a, [], [], [], z)```
```ans = 0.3679 1.2131 2.1496```

Convert numeric input to symbolic form using `sym`, and find the Meijer G-function. For certain symbolic inputs, `meijerG` returns exact symbolic output using other functions.

`meijerG(sym(2), [], [], [], sym(3))`
```ans = 3*exp(-1/3)```
`meijerG(sym(2/5), [], sym(1/2), [], sym(3))`
```ans = (2^(4/5)*3^(1/2)*gamma(1/10))/80```

For symbolic variables or expressions, `meijerG` returns an output in terms of simple or special functions.

```syms a b c d z f = meijerG(a,b,c,d,z)```
```f = (gamma(c - a + 1)*(1/z)^(1 - a)*hypergeom([c - a + 1, d - a + 1],... b - a + 1, 1/z))/(gamma(b - a + 1)*gamma(a - d))```

Substitute values for the variables by using `subs`, and convert values to double by using `double`.

`fVal = subs(f, [a b c d z], [1.2 3 5 7 9])`
```fVal = (266*9^(1/5)*hypergeom([24/5, 34/5], 14/5, 1/9))/(25*gamma(-29/5))```
`double(fVal)`
```ans = 5.7586e+03```

Calculate `fVal` to higher precision using `vpa`.

`vpa(fVal)`
```ans = 5758.5946416377834597597497022199```

Show relations between `meijerG` and simpler functions for given parameter values.

Show that when `a`, `b`, and `d` are empty, and `c = 0`, then `meijerG` reduces to `exp(-z)`.

```syms z meijerG([], [], 0, [], z)```
```ans = exp(-z)```

Show that when `a`, `b`, and `d` are empty, and ```c = [1/2 -1/2]```, then `meijerG` reduces to 2Kv(1,2z1/2).

`meijerG([], [], [1/2 -1/2], [], z)`
```ans = 2*besselk(1, 2*z^(1/2))```

Plot the real and imaginary values of the Meijer G-function for values of `b` and `z`, where ```a = [-2 2]``` and `c` and `d` are empty. Fill the contours by setting `Fill` to `on`.

```syms b z f = meijerG([-2 2], b, [], [], z); subplot(2,2,1) fcontour(real(f),'Fill','on') title('Real Values of Meijer G') xlabel('b') ylabel('z') subplot(2,2,2) fcontour(imag(f),'Fill','on') title('Imag. Values of Meijer G') xlabel('b') ylabel('z')```
` `

## Input Arguments

collapse all

Input, specified as a number or vector, or a symbolic number, variable, vector, function, or expression.

Input, specified as a number or vector, or a symbolic number, variable, vector, function, or expression.

Input, specified as a number or vector, or a symbolic number, variable, vector, function, or expression.

Input, specified as a number or vector, or a symbolic number, variable, vector, function, or expression.

Input, specified as a number or vector, or a symbolic number, variable, vector, function, or expression.

collapse all

### Meijer G-Function

The Meijer G-function ```meijerG([a1,…,an], [an + 1,…,ap], [b1,…,bm], [bm + 1,…,bq], z)``` is a general function that includes other special functions as particular cases, and is defined as

`${G}_{p,q}^{m,n}\left(\begin{array}{c}{a}_{1},\dots ,{a}_{p}\\ {b}_{1},\dots ,{b}_{q}\end{array}|z\right)=\frac{1}{2\pi \text{i}}\int \frac{\left(\prod _{j=1}^{m}\Gamma \left({b}_{j}-s\right)\right)\left(\prod _{j=1}^{n}\Gamma \left(1-{a}_{j}+s\right)\right)}{\left(\prod _{j=m+1}^{q}\Gamma \left(1-{b}_{j}+s\right)\right)\left(\prod _{j=n+1}^{p}\Gamma \left({a}_{j}-s\right)\right)}{z}^{s}ds.$`

## Algorithms

For the Meijer G-function ```meijerG([a1,…,an], [an + 1,…,ap], [b1,…,bm], [bm + 1,…,bq], z)```, for ai ∊ (a1,…,an) and bj ∊ (b1,…,bm), no pair of parameters ai − bj should differ by a positive integer.

The Meijer G-function involves a complex contour integral with one of the following types of integration paths:

• The contour goes from - i ∞ to i ∞ so that all poles of $\Gamma \left({b}_{j}-s\right)$, j = 1, …, m lie to the right of the path, and all poles of $\Gamma \left(1-{a}_{k}+s\right)$, k = 1, …, n lie to the left of the path. The integral converges if $c=m+n-\frac{p+q}{2}>0$, |arg(z)| < c π. If |arg(z)| = c π, c ≥ 0, the integral converges absolutely when p = q and (ψ) < - 1, where $\Psi =\left(\sum _{j=1}^{q}{b}_{j}\right)-\left(\sum _{i=1}^{p}{a}_{i}\right)$. When pq, the integral converges if you choose the contour so that the contour points near i ∞ and - i ∞ have a real part σ satisfying $\left(q-p\right)\sigma >\Re \left(\psi \right)+1-\frac{q-p}{2}$.

• The contour is a loop beginning and ending at and encircling all poles of $\Gamma \left({b}_{j}-s\right)$, j = 1, …, m moving in the negative direction, but none of the poles of $\Gamma \left(1-{a}_{k}+s\right)$, k = 1, …, n. The integral converges if q ≥ 1 and either p < q or p = q and |z| < 1.

• The contour is a loop beginning and ending at - ∞ and encircling all poles of $\Gamma \left(1-{a}_{k}+s\right)$, k = 1, …, n moving in the positive direction, but none of the poles of $\Gamma \left({b}_{j}+s\right)$, j = 1, …, m. The integral converges if p ≥ 1 and either p > q or p = q and |z| > 1.

The integral represents an inverse Laplace transform or, more specifically, a Mellin-Barnes type of integral.

For a given set of parameters, the contour chosen in the definition of the Meijer G-function is the one for which the integral converges. If the integral converges for several contours, all contours lead to the same function.

The Meijer G-function satisfies a differential equation of order max(p, q) with respect to a variable z:

`$\left({\left(-1\right)\right)}^{m+n-p}z\left(\prod _{i=1}^{p}\left(z\frac{d}{dz}-{a}_{i}-1\right)\right)-\prod _{j=1}^{q}\left(z\frac{d}{dz}-{b}_{j}\right)\right){G}_{p,q}^{m,n}\left(\begin{array}{c}{a}_{1},\dots ,{a}_{p}\\ {b}_{1},\dots ,{b}_{p}\end{array}|z\right)=0.$`

If p < q, this differential equation has a regular singularity at z = 0 and an irregular singularity at z = ∞. If p = q, the points z = 0 and z = ∞ are regular singularities, and there is an additional regular singularity at z = (−1)m + n - p.

The Meijer G-function represents an analytic continuation of the hypergeometric function . For particular choices of parameters, you can express the Meijer G-function through the hypergeometric function. For example, if no two of the bh terms, h = 1, …, m, differ by an integer or zero and all poles are simple, then

`${G}_{p,q}^{m,n}\left(\begin{array}{c}{a}_{1},\dots ,{a}_{p}\\ {b}_{1},\dots ,{b}_{p}\end{array}|z\right)=\sum _{h=1}^{m}\frac{\left(\prod _{j=1\dots m,j\ne h}\Gamma \left({b}_{j}-{b}_{h}\right)\right)\left(\prod _{j=1}^{n}\Gamma \left(1+{b}_{h}-{a}_{j}\right)\right)}{\left(\prod _{j=m+1}^{q}\Gamma \left(1+{b}_{h}-{b}_{j}\right)\right)\left(\prod _{j=n+1}^{p}\Gamma \left({a}_{j}-{b}_{h}\right)\right)}{z}^{b}{h}_{p}{F}_{q-1}\left({A}_{h};{B}_{h};{\left(-1\right)}^{p-m-n}z\right).$`

Here p < q or p = q and |z| < 1. Ah denotes

`${A}_{h}=1+{b}_{h}-{a}_{1},\dots ,1+{b}_{h}-{a}_{p}.$`

Bh denotes

`${B}_{h}=1+{b}_{h}-{b}_{1},\dots ,1+{b}_{h}-{b}_{\left(h-1\right)},1+{b}_{h}-{b}_{h+1},\dots ,1+{b}_{h}-{b}_{q}.$`

Meijer G-functions with different parameters can represent the same function.

• The Meijer G-function is symmetric with respect to the parameters. Changing the order inside each of the following lists of vectors does not change the resulting Meijer G-function: [a1, …, an], [an + 1, …, ap], [b1, …, bm], [bm + 1, …, bq].

• If z is not a negative real number and z ≠ 0, the function satisfies the following identity:

`${G}_{p,q}^{m,n}\left(\begin{array}{c}{a}_{1},\dots ,{a}_{p}\\ {b}_{1},\dots ,{b}_{q}\end{array}|z\right)={G}_{q,p}^{n,m}\left(\begin{array}{c}1-{b}_{1},\dots ,1-{b}_{p}\\ 1-{a}_{1},\dots ,1-{a}_{p}\end{array}|\frac{1}{z}\right).$`

.

• If 0 < n < p and r = a1 - ap is an integer, the function satisfies the following identity:

`${G}_{p,q}^{m,n}\left(\begin{array}{c}{a}_{1},{a}_{2},\dots ,{a}_{p-1},{a}_{p}\\ {b}_{1},{b}_{2},\dots ,{b}_{q-1},{b}_{q}\end{array}|z\right)={G}_{p,q}^{m,n}\left(\begin{array}{c}{a}_{p},{a}_{2},\dots ,{a}_{p-1},{a}_{1}\\ {b}_{1},{b}_{2},\dots ,{b}_{q-1},{b}_{q}\end{array}|z\right).$`

.

• If 0 < m < q and r = b1 - bq is an integer, the function satisfies the following identity:

`${G}_{p,q}^{m,n}\left(\begin{array}{c}{a}_{1},{a}_{2},\dots ,{a}_{p-1},{a}_{p}\\ {b}_{1},{b}_{2},\dots ,{b}_{q-1},{b}_{q}\end{array}|z\right)={\left(-1\right)}^{\gamma }{G}_{p,q}^{m,n}\left(\begin{array}{c}{a}_{1},{a}_{2},\dots ,{a}_{p-1},{a}_{p}\\ {b}_{q},{b}_{2},\dots ,{b}_{q-1},{b}_{1}\end{array}|z\right).$`

.

According to these rules, the `meijerG` function call can return `meijerG` with modified input parameters.

 Luke, Y. L., The Special Functions and Their Approximations. Vol. 1. New York: Academic Press, 1969.

 Prudnikov, A. P., Yu. A. Brychkov, and O. I. Marichev, Integrals and Series. Vol 3: More Special Functions. Gordon and Breach, 1990.

 Abramowitz, M., I. A. Stegun, Handbook of Mathematical Functions. 9th printing. New York: Dover Publications, 1970.