フィルターのクリア

Why do the limits of the following two equations have opposite signs? (MATLAB R2024a Update 1 _20240418)

6 ビュー (過去 30 日間)
Why limit((1-(-1)^n)/n, n, 0) = -pi*1i ? limit((1-exp(-pi*n*1i))/n, n, 0) = pi*1i
limit((1-(-1i)^n)/n, n, 0) = limit((1-exp(-pi/2*n*1i))/n, n, 0) = (pi*1i)/2
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>> syms n theta
>> assume(n,"integer")
>> limit((1-(-1)^n)/n, n, 0)
ans =
-pi*1i
>> limit((1-exp(-pi*n*1i))/n, n, 0)
ans =
pi*1i
>> n_value = -10:10;
>> subs(exp(-pi*n*1i) - (-1).^n, n, n_value)
ans =
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
>> limit((1-(-1i)^n)/n, n, 0)
ans =
(pi*1i)/2
>> limit((1-exp(-pi/2*n*1i))/n, n, 0)
ans =
(pi*1i)/2
>> subs(exp(-pi/2*n*1i) - (-1i).^n, n, n_value)
ans =
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
>>
  2 件のコメント
Walter Roberson
Walter Roberson 2024 年 4 月 18 日
(running the code here)
syms n theta
assume(n,"integer")
limit((1-(-1)^n)/n, n, 0)
ans = 
limit((1-exp(-pi*n*1i))/n, n, 0)
ans = 
n_value = -10:10;
subs(exp(-pi*n*1i) - (-1).^n, n, n_value)
ans = 
limit((1-(-1i)^n)/n, n, 0)
ans = 
limit((1-exp(-pi/2*n*1i))/n, n, 0)
ans = 
subs(exp(-pi/2*n*1i) - (-1i).^n, n, n_value)
ans = 
dequan wu
dequan wu 2024 年 4 月 18 日
移動済み: Torsten 2024 年 4 月 18 日
limit((1-(-1)^n)/n, n, 0) have two results, and Matlab only gets one of them.
(1-(-1)^n) = (1+(1i)^n)*(1-(1i)^n)
or
(1-(-1)^n) = (1+(-1i)^n)*(1-(-1i)^n)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>> limit((1+(-1i)^n), n, 0)
ans =
2
>> limit((1+(1i)^n), n, 0)
ans =
2
>> limit((1-(1i)^n)/n, n, 0)
ans =
-(pi*1i)/2
>> limit((1+(1i)^n)*(1-(1i)^n)/n, n, 0)
ans =
-pi*1i
>> limit((1+(-1i)^n)*(1-(-1i)^n)/n, n, 0)
ans =
pi*1i
>>

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

採用された回答

David Goodmanson
David Goodmanson 2024 年 4 月 19 日
編集済み: David Goodmanson 2024 年 4 月 19 日
Hello dq,
I think the behaviour is reasonably clear. The first example is
limit((1-(-1)^n)/n, n, 0) = -pi*i.
If you look at log(-1) the answer is i*pi, because for complex quantities z = r*exp(i*theta), Matlab takes the angle as
-pi < theta <= pi. So (-1) = exp(i*pi)
and the result follows .In the second example,
limit((1-exp(-pi*n*i))/n, n, 0) = pi*i
you have forced (-1) = exp(-i*pi) so the result has a sign change. The other two examples follow since
(-i) = exp(-i*pi/2).
In all cases,
lim[(1-exp(i*a)^n)/n] = lim[(1-exp(i*a*n))/n] = lim[(1-(1+i*a*n +O(n^2))/n] = -i*a
  1 件のコメント
dequan wu
dequan wu 2024 年 4 月 19 日
編集済み: dequan wu 2024 年 4 月 19 日
Thanks!
exp(i*θ)^n = exp(n*(ln|exp(i*θ)| + i*(arg(exp(i*θ)) + 2*k*pi)))
= exp(n*(0+ i*(θ + 2*k*pi))), -pi < θ <= pi, k is integer.
Principal Value: = exp(i*θ*n)

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by