How can I integrate this function?

조회 수: 6 (최근 30일)
Ali Almakhmari
Ali Almakhmari 2023년 4월 2일
댓글: Torsten 2023년 4월 2일
Hey guys, I have this function here: where is the modified Bessel function of the first kind of order K-1. I want to integrate from b (which is a constant I decide on) to infinity. And K and B are also constants which I decide on. This integral that I want to perform is insanely close to the Marcum-Q integral which MATLAB already has a function for (https://www.mathworks.com/help/signal/ref/marcumq.html). Unfortuantely though, I don't think its possible to use it because my is very slightly different. I also tried developing my own function and failed. Any help is appreciated.

채택된 답변

Star Strider
Star Strider 2023년 4월 2일
편집: Star Strider 2023년 4월 2일
The function as presented appears to be a bit ambiguous, so I’m not certain which (if either) of these is correct.
That aside, the result is NaN with an infinite upper limit for both of them —
p = @(r,K,B) 0.5*(r./(2*K*B)).^((K-1)/2) .* exp(-(r+2*K*B)/2) .* besseli(K-1,sqrt(2*K*B*r));
K = 2;
B = 1;
b = rand
b = 0.0492
Result = integral(@(r)p(r,K,B), b, 1E5)
Result = 1.0000
.
  댓글 수: 7
Torsten
Torsten 2023년 4월 2일
Note that the r is still outside the exponentiation in your definition of p.
Star Strider
Star Strider 2023년 4월 2일
Fixed. I was staring so intently at the LaTeX expression that I overlooked that.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2023년 4월 2일
Assuming the the posted formula is correct in having the exp() raised as an exponent to the (r/2KB) then:
Because you want to integrate to r = infinity, examine your p(r) as r increases towards infinity.
exp(-(r+2KB)/2) as r increases towards infinity heads to exp(-infinity) which head towards 0 from above.
That 0-limit is being multiplied by a constant (K-1)/2 which continues to give the 0-limit.
That 0-limit is the exponent of r/(2*K*B) and so that limit would be r^0 which would be limit-1 -- a non-zero constant
The leading 1/2 is a positive multiplicative constant, and a positive constant times a limit-constant gives a positive constant in the limit.
Thus as r goes to infinity the part of the expression before the besseli goes to positive constant.
Now, the integration of a positive constant out to infinity is infinity, so if we ignore the besseli for the moment, we see we are at risk of an infinite outcome of the integral.
When would the true integral potentially be below infinity? Only if the besseli() portion goes towards zero. But for real-valued constant nu, besseli(nu, x) increases without bound with increasing x. And sqrt(2*K*B*r) is strictly increasing in increasing r.
Therefore, if the exp() is properly part of the exponent of (r/2KB) then the integral of p as r goes to infinity is going to be infinite.
... Now if the exp() should not be part of the exponent, if it should be at the same baseline as the (r/2KB) then the analysis would be notably different.
  댓글 수: 1
Torsten
Torsten 2023년 4월 2일
Assuming the the posted formula is correct in having the exp() raised as an exponent to the (r/2KB)
It doesn't seem to be the case:

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Bessel functions에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by