problem using fplot for small arguments of spherical bessel functions
i’m trying to plot spherical bessel functions (i. e. half integer order bessel functions) for small arguments (x << 1) and i’ve tried using vectors and it turns out very well; but the problem is when i try to use symbolic variable to define the function and plot it, i observe like meshing problems or diverging behavior (like in the image below). is there a way to fix it?
i’ve already tried modify the meshdensity but the problem remains. thanks a lot
l = 6; % order of the bessel function
syms r
rho = sqrt(pi./(2*r)) .* besselj(l + 0.5,r); % definition of spherical bessel function
% in terms of bessel function
f1 = figure;
fplot(real(rho),[0 0.35])
ylim([-0.1,0.5])i’m trying to plot spherical bessel functions (i. e. half integer order bessel functions) for small arguments (x << 1) and i’ve tried using vectors and it turns out very well; but the problem is when i try to use symbolic variable to define the function and plot it, i observe like meshing problems or diverging behavior (like in the image below). is there a way to fix it?
i’ve already tried modify the meshdensity but the problem remains. thanks a lot
l = 6; % order of the bessel function
syms r
rho = sqrt(pi./(2*r)) .* besselj(l + 0.5,r); % definition of spherical bessel function
% in terms of bessel function
f1 = figure;
fplot(real(rho),[0 0.35])
ylim([-0.1,0.5]) i’m trying to plot spherical bessel functions (i. e. half integer order bessel functions) for small arguments (x << 1) and i’ve tried using vectors and it turns out very well; but the problem is when i try to use symbolic variable to define the function and plot it, i observe like meshing problems or diverging behavior (like in the image below). is there a way to fix it?
i’ve already tried modify the meshdensity but the problem remains. thanks a lot
l = 6; % order of the bessel function
syms r
rho = sqrt(pi./(2*r)) .* besselj(l + 0.5,r); % definition of spherical bessel function
% in terms of bessel function
f1 = figure;
fplot(real(rho),[0 0.35])
ylim([-0.1,0.5]) fplot, syms, spherical bessel function MATLAB Answers — New Questions