Borrar filtros
Borrar filtros

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

6 visualizaciones (últimos 30 días)
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 comentarios
Walter Roberson
Walter Roberson el 18 de Abr. de 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 el 18 de Abr. de 2024
Movida: Torsten el 18 de Abr. de 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
>>

Iniciar sesión para comentar.

Respuesta aceptada

David Goodmanson
David Goodmanson el 19 de Abr. de 2024
Editada: David Goodmanson el 19 de Abr. de 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 comentario
dequan wu
dequan wu el 19 de Abr. de 2024
Editada: dequan wu el 19 de Abr. de 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)

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by