Infinite sum with Bessel's function
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have this sum with the Bessel function that I am trying to calculate and plot.
Any help would be greatly appreaciated.
Thank you
2 Kommentare
Akzeptierte Antwort
Torsten
am 11 Aug. 2022
Bearbeitet: Torsten
am 11 Aug. 2022
n = 60;
sstep = 1;
a_k = J0ROOTS(n,sstep);
r = (0:0.01:1).';
t = 0:0.1:1;
S = zeros(numel(r),numel(t));
for i = 1:numel(t)
S(:,i) = sum(2*besselj(0,a_k.*r)./(a_k.^2.*besselj(1,a_k)).*exp(-a_k.*t(i)),2);
end
plot(r,S)
function x=J0ROOTS(n,sstep)
if nargin==0
n=20;
sstep=1;
elseif nargin==1
sstep=1;
end
J0=@(x) besselj(0,x);
k=0; i=0;
while k<n
i1=i+sstep;
if J0(i)*J0(i1)<0
k=k+1;
x(k)=fzero(J0,[i i1]);
end
i=i1;
end
end
6 Kommentare
Torsten
am 30 Mär. 2023
n = 60;
sstep = 1;
a_k = J0ROOTS(n,sstep);
r = (0:0.01:1).';
t = 0:0.1:1;
S = zeros(numel(r),numel(t));
for i = 1:numel(t)
for k = 1:numel(r)
for l = 1:n
S(k,i) = S(k,i) + 2*besselj(0,a_k(l)*r(k))/(a_k(l)^2*besselj(1,a_k(l)))*exp(-a_k(l)*t(i));
end
end
end
plot(r,S)
function x=J0ROOTS(n,sstep)
if nargin==0
n=20;
sstep=1;
elseif nargin==1
sstep=1;
end
J0=@(x) besselj(0,x);
k=0; i=0;
while k<n
i1=i+sstep;
if J0(i)*J0(i1)<0
k=k+1;
x(k)=fzero(J0,[i i1]);
end
i=i1;
end
end
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Linear Algebra finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!