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

조회 수: 1 (최근 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개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by