sum of Bessel function

13 ビュー (過去 30 日間)
Ngo Nhan
Ngo Nhan 2022 年 11 月 28 日
コメント済み: Ngo Nhan 2022 年 12 月 1 日
Hello, I am trying to plot double sum of fuction that have a Bessel fuction from -pi to pi, like
which is Bessel function.
My code is
syms x m
assume(in(m,'integer') & m>=0);
assume(x>-pi & x<pi);
J=besselj(0,pi/2*m);
A = 2/((2*m+1)*pi)*J*sin((2*m+1)*1000*x-(2*m+1)*pi/2);
g = symsum(A,m,0,Inf);
fmesh(g,5*[-pi pi],'MeshDensity',1e2);
but this show error
Warning: Error updating FunctionSurface.
The following error was reported evaluating the function in FunctionLine update: Unable to convert expression
containing remaining symbolic function calls into double array. Argument must be expression that evaluates to
number.

回答 (2 件)

Torsten
Torsten 2022 年 11 月 28 日
syms x
syms m integer
A = 2/((2*m+1)*pi)*besselj(0,pi/2*m)*sin((2*m+1)*1000*x-(2*m+1)*pi/2)
g = symsum(A,m,0,Inf)
fplot(g,[-5*pi 5*pi])
  1 件のコメント
Ngo Nhan
Ngo Nhan 2022 年 11 月 30 日
編集済み: Ngo Nhan 2022 年 11 月 30 日
thanks so much, but Matlab could not plot with your code
Here is error
Warning: Error updating FunctionLine.
The following error was reported evaluating the function in FunctionLine update: Unable to convert expression
containing remaining symbolic function calls into double array. Argument must be expression that evaluates to
number.

サインインしてコメントする。


Torsten
Torsten 2022 年 11 月 30 日
m = 0:250;
x = linspace(-5*pi,5*pi,1000).';
A = 2./((2*m+1)*pi).*besselj(0,pi/2*m).*sin(1000*(2*m+1).*x-(2*m+1)*pi/2);
f = sum(A,2);
plot(x,f)
  1 件のコメント
Ngo Nhan
Ngo Nhan 2022 年 12 月 1 日
thansks so much

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeBessel functions についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by