improper integral: exp(ikx) undefined in Matlab?

7 ビュー (過去 30 日間)
Niklas Kurz
Niklas Kurz 2021 年 6 月 19 日
編集済み: Niklas Kurz 2021 年 6 月 20 日
I wanna integrate:
With solution:
But Matlab gives NAN:
syms x k; assume(k,'integer'); int(exp(1i*k*x),x,-inf,inf)

採用された回答

Steven Lord
Steven Lord 2021 年 6 月 19 日
What is the value of your integral when k is equal to 0?
syms x k;
assume(k,'integer');
k = 0;
int(exp(1i*k*x),x,-inf,inf)
ans = 
This makes sense, as you're just integrating 1 over the whole real line.
What's the value of your integral when k is 1?
k = 1;
int(exp(1i*k*x),x,-inf,inf)
ans = 
NaN
Does this make sense? Let's look at the real and imaginary parts of the function you're integrating.
f = 8*pi;
fplot(real(exp(1i*k*x)), [-f, f], 'k--')
hold on
fplot(imag(exp(1i*k*x)), [-f, f], 'c-')
Those oscillations could be problematic. Does this integral exist? Let's look at a series of values of those integrals for gradually increasing limits.
for L = 0:0.5:10
value = int(exp(1i*k*x), -L*pi, L*pi);
fprintf("The value of the integral from %g*pi to %g*pi is %g.\n", -L, L, value);
end
The value of the integral from -0*pi to 0*pi is 0. The value of the integral from -0.5*pi to 0.5*pi is 2. The value of the integral from -1*pi to 1*pi is 0. The value of the integral from -1.5*pi to 1.5*pi is -2. The value of the integral from -2*pi to 2*pi is 0. The value of the integral from -2.5*pi to 2.5*pi is 2. The value of the integral from -3*pi to 3*pi is 0. The value of the integral from -3.5*pi to 3.5*pi is -2. The value of the integral from -4*pi to 4*pi is 0. The value of the integral from -4.5*pi to 4.5*pi is 2. The value of the integral from -5*pi to 5*pi is 0. The value of the integral from -5.5*pi to 5.5*pi is -2. The value of the integral from -6*pi to 6*pi is 0. The value of the integral from -6.5*pi to 6.5*pi is 2. The value of the integral from -7*pi to 7*pi is 0. The value of the integral from -7.5*pi to 7.5*pi is -2. The value of the integral from -8*pi to 8*pi is 0. The value of the integral from -8.5*pi to 8.5*pi is 2. The value of the integral from -9*pi to 9*pi is 0. The value of the integral from -9.5*pi to 9.5*pi is -2. The value of the integral from -10*pi to 10*pi is 0.
So should the value of this integral on the infinite interval be 0, -2, or something inbetween?
  1 件のコメント
Niklas Kurz
Niklas Kurz 2021 年 6 月 20 日
編集済み: Niklas Kurz 2021 年 6 月 20 日
yea, that's the problem aobut the delta-distribution not being a function, so it is hard for matlab to see in infinit domain. Or the variable k is not restricted enough. At least.
syms x; fourier(x^0)
gives the adaped solution (evaluating exactly that integral)

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDialog Boxes についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by