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

1 visualizzazione (ultimi 30 giorni)
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 Commenti
Walter Roberson
Walter Roberson il 18 Apr 2024
(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 il 18 Apr 2024
Spostato: Torsten il 18 Apr 2024
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
>>

Accedi per commentare.

Risposta accettata

David Goodmanson
David Goodmanson il 19 Apr 2024
Modificato: David Goodmanson il 19 Apr 2024
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 Commento
dequan wu
dequan wu il 19 Apr 2024
Modificato: dequan wu il 19 Apr 2024
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)

Accedi per commentare.

Più risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by