Generalized exponential integral with negative argument

6 ビュー (過去 30 日間)
Benjamin Moll
Benjamin Moll 2016 年 9 月 12 日
コメント済み: Walter Roberson 2016 年 9 月 15 日
Is there a way to compute the generalized exponential integral E[a,x]=int_1^infty e^(-x t) t^a dt with negative x? In particular, I need to compute the integral int_1^z Exp[-y^b/b] dy where b<0 and z>1. (I need to do this for 1000’s of z-values so numerical integration is not an option) Mathematica tells me this equals an expression involving ExpIntegralE[(-1 + b)/b, 1/b] (to be precise ExpIntegralE[(-1 + b)/b, 1/b] - z ExpIntegralE[(-1 + b)/b, z^b/b])/b. So since b<0, x=1/b is negative, and this causes a problem.
There seems to be a related thread but with no answer https://www.mathworks.com/matlabcentral/newsreader/view_thread/289192
Finally, there is an implementation of E[a,x] on file exchange https://www.mathworks.com/matlabcentral/fileexchange/52694-generalised-exponential-integral but it cannot handle negative x-values.

採用された回答

Star Strider
Star Strider 2016 年 9 月 12 日
See if expint will do what you want. There’s also a Symbolic Math Toolbox function by the same name, so search for it if you want it instead.
The gammainc function computes the incomplete gamma function.
  10 件のコメント
Star Strider
Star Strider 2016 年 9 月 15 日
My (our) pleasure!
Add your vote to mine for Walter’s Answer, and Walter gets the same 4 RP’s I got.
Walter Roberson
Walter Roberson 2016 年 9 月 15 日
The defining formula for Ei with two arguments is in terms of the Gamma function, which has singularities at every negative integer, so if your 1/b is a negative integer you should be expecting a singularity.

サインインしてコメントする。

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 9 月 12 日
編集済み: Walter Roberson 2016 年 9 月 12 日
This formula appears to work. It requires the symbolic toolbox
(-z^(b+1)*hypergeom([(1/2)*(b+1)/b], [3/2, (1/2)*(3*b+1)/b], (1/4)*z^(2*b)/b^2)+b*z*(b+1)*hypergeom([(1/2)/b], [1/2, (1/2)*(2*b+1)/b], (1/4)*z^(2*b)/b^2)+hypergeom([(1/2)*(b+1)/b], [3/2, (1/2)*(3*b+1)/b], (1/4)/b^2)+(-b^2-b)*hypergeom([(1/2)/b], [1/2, (1/2)*(2*b+1)/b], (1/4)/b^2))/(b*(b+1))
Note: this might fail if 1/b is an integer
Reference: Maple
  2 件のコメント
Benjamin Moll
Benjamin Moll 2016 年 9 月 13 日
Great thank you Star Strider and Walter. Both formulas work and give the same answer. One question left: I need to do this for a vector of 1000 z's, e.g. z=linspace(1,2,1000). The way you guys do it, it cannot handle vectors. Is there a way to get this to work without writing a loop?
Walter Roberson
Walter Roberson 2016 年 9 月 13 日
編集済み: Walter Roberson 2016 年 9 月 15 日
syms b z
G = (-z^(b+1)*hypergeom([(1/2)*(b+1)/b], [3/2, (1/2)*(3*b+1)/b], (1/4)*z^(2*b)/b^2)+b*z*(b+1)*hypergeom([(1/2)/b], [1/2, (1/2)*(2*b+1)/b], (1/4)*z^(2*b)/b^2)+hypergeom([(1/2)*(b+1)/b], [3/2, (1/2)*(3*b+1)/b], (1/4)/b^2)+(-b^2-b)*hypergeom([(1/2)/b], [1/2, (1/2)*(2*b+1)/b], (1/4)/b^2))/(b*(b+1));
GG = subs(G, {z, b}, {linspace(1,2,1000), -sqrt(pi)});
GGn = double(GG);

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by