How can I integrate this function?

5 visualizzazioni (ultimi 30 giorni)
Ali Almakhmari
Ali Almakhmari il 2 Apr 2023
Commentato: Torsten il 2 Apr 2023
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.

Risposta accettata

Star Strider
Star Strider il 2 Apr 2023
Modificato: Star Strider il 2 Apr 2023
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 Commenti
Torsten
Torsten il 2 Apr 2023
Note that the r is still outside the exponentiation in your definition of p.
Star Strider
Star Strider il 2 Apr 2023
Fixed. I was staring so intently at the LaTeX expression that I overlooked that.

Accedi per commentare.

Più risposte (1)

Walter Roberson
Walter Roberson il 2 Apr 2023
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 Commento
Torsten
Torsten il 2 Apr 2023
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:

Accedi per commentare.

Categorie

Scopri di più su Programming in Help Center e File Exchange

Prodotti


Release

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by