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 CenterFile Exchange 中查找有关 Calculus 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by