where the jump of the phase function happen?

7 views (last 30 days)
I know that (if Iam correct), phase(f(z)) =arctan(f(z)) ,(where f(z) is complex number ) is multivalued function, that means for example if arctan(f(z))= x, there is infinite number of angles (x) has the same tan value = the value f(z). So if we want to make arctan continuous we have to ristrect the rang of this function in this interval (-pi/2 pi/2). where z=x+iy
My questions are:
1- How can I determined the points where the jump happen? are they when the real part of complex number=0?(but phase =arcta(y/x)= arctan (y/0) =pi/2)
2-why when I plotted the phase of the function f(z) in this interval (-pi/2 pi/2) , I still have the same jump which appear as discontinuity of the phase of the function f(z)?
I use this code
re_z = -pi/2:0.01:pi/2;
im_z = -pi/2:0.01:pi/2;
[re_z,im_z] = meshgrid(re_z,im_z);
z = re_z + 1i*im_z;
f_of_z_result = polyval(p,z);
figure();
subplot(2,2,1)
surf(re_z,im_z,angle(f_of_z_result),'EdgeColor','none')
colorbar
title('phase(f_k(z))')
xlabel('Z_R')
ylabel('Z_I')
I appreciate any help

Accepted Answer

Aisha Mohamed
Aisha Mohamed on 7 Sep 2022
Thanks Bruno
I know my a little information do not compare with expers like you and other experts in this group, but really I want to understad the worth information that you explane. Thank you so much. please allow me to ask more,
1- is this demi-line is the same for all second degree polynomail { y=0; x<=0, z=x+1i*y }?
2-please , what did you mean by your polynomial p(z) has two solutions of p(z)=x with x real and negative. ? I know second degree funtion has two root as a solution p(z)=0, but you mean p(z)=x with x real and negative. we have many values of z satisfay this condition not only two for example:
% -0.1320 - 0.0878i
% -0.1150 - 0.0756i
% -0.1067 - 0.0694i
2-if I have this polynomial (4th degree) p =[(0.6 - 0.7i) (-0.6000 + 0.0020i) (0.2449 + 0.0049i) (0.2000 + 0.0020i) (0.2 + 0.0010i) ] . is it has the same demi-line { y=0; x<=0, z=x+1i*y } and discontnue at four "places".
3 Becaufe of the discontinue at the negative values of x, can I avoied it by chosing this rang of z,
re_z = 0:0.01:pi/2;
im_z = 0:0.01:pi/2; and then I got this figure,
I appreciate any help.
  10 Comments
Torsten
Torsten on 11 Sep 2022
Because the phase(p(z)) at z=(0+0i) equales 2.1055 not +pi or -pi.
If you look at the plot of the "discontinuity front", you can see that z=0 is not therein. So angle(p(z)) is continuous at z = 0. Again: angle(p(z)), not angle(z).

Sign in to comment.

More Answers (1)

Bruno Luong
Bruno Luong on 6 Sep 2022
Edited: Bruno Luong on 6 Sep 2022
angle(z) is discontinue at the half line { y=0; x<=0, z=x+1i*y }.
The phase jumps from -pi for imaginary part y < 0 to +pi for y > 0. To make thing more complicated for y=0 in IEEE754 it can take the "IEEE-sign" of either +1 or -1, and the angle(z) returns +/-pi depending of the IEEE-sign of y (which is 0 mathematically).
In your case you have to determine when polyval(p,z)* is real and negative, which will implies angle discontinuity.
(*) you didn't tell us what is p.
  17 Comments
Bruno Luong
Bruno Luong on 12 Sep 2022
Edited: Bruno Luong on 13 Sep 2022
One more simplification. The extrapolation can be computed with Pascal's triangle without using Vandermond matrix.
p = rand(1,7) + 1i*rand(1,7);
x = linspace(-100,0,513);
% Solve p(z) = x
npnts = length(x);
z = zeros(length(p)-1,npnts);
for k = 1:npnts
pk = p;
pk(end) = pk(end)-x(k);
z(:,k) = roots(pk);
end
% reorder the points so that each row contain the same "branch" of solution
cu = max(abs(z(:)));
extrapn = 5; % how many points used to predict the next point in a branch
Pascal = pascal(extrapn+1,1);
for j=2:npnts
% prediction by fitting a polynomaial on old data
if j <= extrapn+1
a = -Pascal(j,j:-1:2).';
end
zp = z(:,max(j-extrapn,1):j-1)*a;
% find permutation to match the prediction
M = matchpairs(abs(zp.'-z(:,j)),cu);
M = sortrows(M,2);
z(:,j) = z(M(:,1),j);
end
% Group them as single complex curve
z(:,end+1) = NaN;
zjump = reshape(z.', 1, []);
zjr = real(zjump);
zji = imag(zjump);
% Graphic
x=linspace(min(zjr),max(zjr));
y=linspace(min(zji),max(zji));
[X,Y]=meshgrid(x,y);
Z=X+1i*Y;
close all
surf(x,y,angle(polyval(p,Z)))
hold on
zlo = -10; % just below -pî, the lowest possible value of phase
plot3(zjr, zji, zlo*ones(size(zjr)), 'r', 'linewidth',2);

Sign in to comment.

Categories

Find more on Special Functions in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!