MATLAB Answers

Bessel problem "inf+ infi"

8 views (last 30 days)
Hello,
I'm getting a "inf+ infi" error or nan when I compute the following code with bessel functions:
freq = linspace(4*1e6, 31*1e6, 0.5*1e6) ;
w = 2*pi.*freq; % angular frequency
%r = d/2; % wire radius
p= 6.5 *1e-3;
d= 0.6*1e-3;
mu0 = 4*pi*1e-7;
mur= 200;
eta0 = 377;
sigw= 1.32*1e6;
Rw = (pi*sigw*(r^2))^(-1);
%tau = mu0*sigw*(r^2);
tau = mu0*mur*sigw*(r^2);
num = sqrt(1i.*w.*tau).*besselj(0, sqrt(1j.*w.*tau));
The program is simple tough, I have numerical value for sqrt(1j.*w.*tau) but when I apply Bessel to it I don't get a numerical value.
Could you please help me ?
Thank you.

Accepted Answer

Alan Stevens
Alan Stevens on 14 Apr 2021
The following works with no inf or nan problems
freq = linspace(4*1e6, 31*1e6, 100) ;
w = 2*pi.*freq; % angular frequency
p= 6.5 *1e-3;
d= 0.6*1e-3;
r = d/2; % wire radius
mu0 = 4*pi*1e-7;
mur= 200;
eta0 = 377;
sigw= 1.32*1e6;
Rw = (pi*sigw*(r^2))^(-1);
tau = mu0*mur*sigw*(r^2);
num = sqrt(1i.*w.*tau).*besselj(0, sqrt(1j.*w.*tau));
  1 Comment
Salwa Ben Mbarek
Salwa Ben Mbarek on 15 Apr 2021
Thank you so much for your help sir !

Sign in to comment.

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!