bessel funtion drawing problem part two
I am trying to draw the Neumann Bessel Function. I understand why I need to use harmonic function to draw the Y0(x), but why can’t I draw Y1(x) and Y2(x).
%Neumann Bessel Function
x=(0:0.01:15).’;
i=0:50;
hold on
set(gca,’YLim’,[-1,1]); %range
set(gca,’XLim’,[0,15]); %domain
for m=0:2
j=sum((((-1).^i)./(factorial(i).*factorial(i+m))).*(x./2).^(2*i+m),2);
if m ==0
y = bessely(m, x);
else
i_minus=m:50;
j_minus=sum((((-1).^i_minus)./(factorial(i_minus).*factorial(i_minus-m))).*(x./2).^(2*i_minus-m),2);
y=(j.*cos(m*pi)-j_minus)./(sin(m*pi));
end
plot(x,y)
end
legend(‘Y0′,’Y1′,’Y2’)I am trying to draw the Neumann Bessel Function. I understand why I need to use harmonic function to draw the Y0(x), but why can’t I draw Y1(x) and Y2(x).
%Neumann Bessel Function
x=(0:0.01:15).’;
i=0:50;
hold on
set(gca,’YLim’,[-1,1]); %range
set(gca,’XLim’,[0,15]); %domain
for m=0:2
j=sum((((-1).^i)./(factorial(i).*factorial(i+m))).*(x./2).^(2*i+m),2);
if m ==0
y = bessely(m, x);
else
i_minus=m:50;
j_minus=sum((((-1).^i_minus)./(factorial(i_minus).*factorial(i_minus-m))).*(x./2).^(2*i_minus-m),2);
y=(j.*cos(m*pi)-j_minus)./(sin(m*pi));
end
plot(x,y)
end
legend(‘Y0′,’Y1′,’Y2’) I am trying to draw the Neumann Bessel Function. I understand why I need to use harmonic function to draw the Y0(x), but why can’t I draw Y1(x) and Y2(x).
%Neumann Bessel Function
x=(0:0.01:15).’;
i=0:50;
hold on
set(gca,’YLim’,[-1,1]); %range
set(gca,’XLim’,[0,15]); %domain
for m=0:2
j=sum((((-1).^i)./(factorial(i).*factorial(i+m))).*(x./2).^(2*i+m),2);
if m ==0
y = bessely(m, x);
else
i_minus=m:50;
j_minus=sum((((-1).^i_minus)./(factorial(i_minus).*factorial(i_minus-m))).*(x./2).^(2*i_minus-m),2);
y=(j.*cos(m*pi)-j_minus)./(sin(m*pi));
end
plot(x,y)
end
legend(‘Y0′,’Y1′,’Y2’) differential equations, plot MATLAB Answers — New Questions