Matlab中是否有内置函数来计算跟随积分?

时间:2016-07-11 03:16:08

标签: matlab numerical-methods

我需要找到以下积分的值:

enter image description here

有没有人知道Matlab中是否有内置函数来计算它?

1 个答案:

答案 0 :(得分:2)

In reading through the referenced paper, which was later expanded into a book, I don't see any direct equality expressed for the author's definition of the generalized incomplete gamma function that can be replicated using the Matlab's Elementary Math library. The authors actually use the IMSL Fortran subroutine QDAGI to directly integrate and generate their table of values (sadly, only given to five decimal places). Therefore, the most direct route in evaluating such a function is to use integral.

The raw incomplete generalized gamma function can be written inline as

iggamma = @(x,alpha,b) integral(@(t) (t+x).^(alpha-1) .* exp(-(t+x)-b./(t+x)),0,Inf,'ArrayValued',true)

where I shifted t to t+x such that the lower bound was always 0 and an array-valued x could be passed. The table in the book scales this raw function by a term involving what the authors call a modified Bessel function of the third kind but what the Mathworks calls a modified Bessel function of the second kind besselk (because that's not confusing at all). The scaled version would be:

iggammas = @(x,alpha,b) iggamma(x,alpha,b) ./ ( 2*b.^(alpha/2) .* besselk(alpha,2*sqrt(b)))

The scaled version matches most of the values I checked to four decimal places with a few disagreeing on the fifth; however, I would chalk this up to differences in rounding and integration tolerance parameters.