How to make integral of Hankel function at infinite?
古いコメントを表示
Hi guys,
I have a question on numerical integral of Hankel functions, need help from all you. Thank you in advance
How do we treat with integral of a function contains Hankel function from 0 to infinite? for example, function=x.besselh(1,0,x)?
statement "quad" not allow at infinite.
回答 (2 件)
Mike Hosea
2012 年 9 月 25 日
0 投票
Use INTEGRAL. If you don't have R2012a or later, use QUADGK. If you don't have QUADGK, it's time to upgrade.
2 件のコメント
tran
2012 年 9 月 26 日
Mike Hosea
2012 年 9 月 26 日
I didn't even think about the function you were integrating. I assumed it was integrable. I'm not saying QUADGK can handle any integrable problem, because there are some that it can't, but if you're going to try to integrate a function that oscillates with increasing amplitude as x increases, I don't think it matters what method you use.
Matt Fig
2012 年 9 月 25 日
This one is easy. Because:
besselh(1,0,x) % Zero for all x.
we know the integral from 0 to inf is 0.
8 件のコメント
tran
2012 年 9 月 26 日
Walter Roberson
2012 年 9 月 26 日
By converting to the equivalent BesselJ and BesselK functions and evaluating those, you get 1 + 0i
This is a difficult integral to evaluate numerically, as Mike noted. What you can do is approximate it because you know it converges. This takes a while to run, so be warned. For greater precision you will need to adjust the conditional on the WHILE loop:
f = @(x) besselh(0,1,x);
I = 0;
A = 1;
ii = 1;
while abs(A)>1e-3
A = quadgk(f,(ii-1)*20,ii*20); % integrate intervals and sum
I = I + A;
ii = ii + 1;
end
I end up with: I = 0.9991 - 0.0001i Which tends to confirm Walter's solution. You could also break the besselh into besselj and bessely then run two loops. This might be actually faster.
tran
2012 年 9 月 26 日
Matt Fig
2012 年 9 月 26 日
tran, I understand that the approach I showed above is limited. Are you listening to Mike's and my advice about the difficulty of integrating this particular function? Just because you can write something down does not mean that it is easy to calculate! I have offered a way to get something towards a solution of your problem. I assume something is better than nothing, which is what quadgk(f,0,inf) gives...
If you want to evaluate this integral numerically, feel free to find another approach. I don't know if another approach will work faster and/or be more accurate. If you find one, please let us know how you did it!
tran
2012 年 9 月 27 日
Walter Roberson
2012 年 9 月 27 日
Looks to me like the two component parts of besselh both oscillate infinitely often towards x=infinity, and it appears that although the oscillations decay that they do so much more slowly than x increases; this leads to the indeterminate (infinity times 0) + I * (infinity times 0) as the limit at infinity, which is undefined.
カテゴリ
ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!