Bessel function Errors reproducing Wronskian

15 views (last 30 days)
I am trying to reproduce the Wronskians of the Bessel functions.
this should hold true for any complex argument Z to my knowledge.
I am making use of
m=5; % I have the same issue for other values of m.
Z=linspace(-200,200,400)+1i*(linspace(-200,200,400).');
JmZ=besselj(m,Z);
H1mZ=besselh(m,1,Z);
H2mZ=besselh(m,2,Z);
dJmZ=(1/2).*(besselj(m-1,Z)-besselj(m+1,Z));
dH1mZ=(1/2).*(besselh(m-1,1,Z)-besselh(m+1,1,Z));
dH2mZ=(1/2).*(besselh(m-1,2,Z)-besselh(m+1,2,Z));
figure
contour(linspace(-200,200,400),linspace(-200,200,400),log10(abs(1-(JmZ.*dH1mZ-H1mZ.*dJmZ)./(2i./(pi.*Z)))),[-16,-8,0,1,10])
figure
contour(linspace(-200,200,400),linspace(-200,200,400),log10(abs(1-(JmZ.*dH2mZ-H2mZ.*dJmZ)./(-2i./(pi.*Z)))),[-16,-8,0,1,10])
in order to evaluate the error.
For the first expression I am retrieiving a large error in the Lower Half Plane for the first expression and in the Upper Half Plane for the second expression.
Are there any ways to reduce this error in order to get reasonable accuracy in these regions?
I have tried using different expressions for the derivatives such as
% dJmZ=(m./Z).*JmZ - besselj(m+1,Z);
% dJmZ= (JmZ - besselj(m,Z+sqrt(eps)))./(-sqrt(eps));
and the equivalent for the derivatives of the Hankel functions.
I have also attempted intoducing the scalings into the problem
JmZS=besselj(m,Z,1);
H1mZS=besselh(m,1,Z,1);
H2mZS=besselh(m,2,Z,1);
dJmZS=(1/2).*(besselj(m-1,Z,1)-besselj(m+1,Z,1));
dH1mZS=(1/2).*(besselh(m-1,1,Z,1)-besselh(m+1,1,Z,1));
dH2mZS=(1/2).*(besselh(m-1,2,Z,1)-besselh(m+1,2,Z,1));
figure
contour(linspace(-200,200,400),linspace(-200,200,400),log10(abs(1-(JmZS.*dH1mZS-H1mZS.*dJmZS)./(2i./(pi.*Z).*(exp(abs(imag(alpha))+1i.*Z))))),[-16,-8,0,1,10])
figure
contour(linspace(-200,200,400),linspace(-200,200,400),log10(abs(1-(JmZS.*dH2mZS-H2mZS.*dJmZS)./(-2i./(pi.*Z).*(exp(abs(imag(alpha))+1i.*Z)))),[-16,-8,0,1,10])
However this makes little to no difference.
  2 Comments
Matthew King
Matthew King on 2 Mar 2021
I was not, although trying this did not improve the accuracy.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!