How to perform correct numerical integration of equations containing Bessel functions ?

7 views (last 30 days)
I am trying to numerically integrate ths improper integral using "integrate" but the output is un-converged:
What would be the right way to solve this equation in MATLAB ?

Answers (1)

Torsten
Torsten on 28 Feb 2024
Edited: Torsten on 28 Feb 2024
I suspect you want exp(-zeta^2/(4*0.0277)) instead of exp(zeta^2/(4*0.0277)) in your integrand.
And why do you add the same Bessel function two times : J0(103.562*zeta)+J0(103.562*zeta) ? This gives 2*J0(103.562*zeta) :-)
  2 Comments
ishan
ishan on 28 Feb 2024
Hello Torsten,
Yes, it should exp(-zeta^2/(4*0.0277)). It was a mistake while typing this question.
Those two values are two of the many values which I have. It will simplify to 2 J0 but it will not be everytime. I wrote them so that I can post the equation here wih example values.
I broke down the calculations into different parts and this is an isolated indefinite integral containing the Bessel function
fun = @(xi) besselj(0,106.4202*xi);
test = integral( fun,0,Inf);
This is the warning it throws up:
Warning: Reached the limit on the maximum number of intervals in use. Approximate bound on
error is 3.3e+07. The integral may not exist, or it may be difficult to approximate
numerically to the requested accuracy.
> In integralCalc/iterateScalarValued (line 372)
In integralCalc/vadapt (line 132)
In integralCalc (line 83)
In integral (line 87)
In test_program (line 55)
Torsten
Torsten on 28 Feb 2024
Seems to be difficult to integrate up to Inf:
syms x
vpa(int(besselj(0,106.4202*x),x,0,Inf))
ans = 
0.0093967122783080660919954783140556
format long
fun = @(xi) besselj(0,106.4202*xi);
test = integral( fun,0,6)
test =
0.009399230000459
testInf = integral( fun,0,Inf)
Warning: Reached the limit on the maximum number of intervals in use. Approximate bound on error is 3.3e+07. The integral may not exist, or it may be difficult to approximate numerically to the requested accuracy.
testInf =
-3.106533748191589e+07

Sign in to comment.

Categories

Find more on Special Functions in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!