How to calculate Bessel function of order zero?

In summary, the individual is attempting to plot a figure from a journal article using equations provided in an inserted image. Despite writing a script, they are not getting the expected plot and believe there may be an error in the values of ##I_{0}## and ##I_{1}##. They ask for assistance in identifying and correcting the error. After reviewing the code, it is determined that there was a missing dot in line 6, which has been fixed.
  • #1
positroncascade
2
0
TL;DR Summary
I try to plot a figure from an article. The analytical solution is given by Bessel function of order zero. I wrote my MATLAB script but it doesn't give results as expected. I need help on evaluating Bessel function of order zero.
Hello everyone.

I try to plot a figure from a journal article. I gave the equations in the inserted image. I wrote the script given below for that. I expect to obtain a plot like the one given on the left but I end up with something totally different. So, the values of ##I_{0}## and ##I_{1}## are probably wrong. How can I evaluate them correctly? Can you help me to spot my error?

Matlab:
phi = linspace(0.001, 1000, 1000000);
v = 2;
lRp = sqrt((1./phi).*((v+1)^2-1));
I1 = besseli(1,lRp);
I0 = besseli(0,lRp);
h = 1 - 2./lRp*(I1/I0);
plot(phi,h)
set(gca, 'XScale', 'log')

Thank you so much!

Capture.PNG
 
Last edited:
Physics news on Phys.org
  • #2
You are missing dots in line 6. Fixed:
Matlab:
phi = linspace(0.001, 1000, 1000000);
v = 2;
lRp = sqrt((1./phi).*((v+1)^2-1));
I1 = besseli(1,lRp);
I0 = besseli(0,lRp);
h = 1 - 2./lRp.*(I1./I0);
plot(phi,h)
set(gca, 'XScale', 'log')
 
  • Like
Likes DrClaude and positroncascade

Similar threads

Replies
6
Views
2K
Replies
2
Views
3K
Replies
3
Views
2K
Replies
1
Views
2K
Replies
3
Views
2K
Back
Top