why I have this discontinuity when I plot the following function by using the MATLAB?

I used Matlab to plot the phase of this function $f_k(z)= (-0.1540 + 0.2600i)+ ( 0.4347 + 0.0914i)z+( 0.7756 - 0.4566i)z^2.$, but its figure shows discontinuity as shown in the following figure. Could anyone please from these community experts explain why this discontinuity happened?
I will appriciate any help.
many thanks

7 Comments

"why I have this discontinuity when I plot the following function by using the MATLAB?"
Because that's how the function behaves
%Function
f_k = @(z) (-0.1540 + 0.2600i)+ ( 0.4347 + 0.0914i)*z+( 0.7756 - 0.4566i)*z.^2;
%Phase of the function
fphase = @(z) angle(f_k(z));
vec = linspace(-6,6,200);
[X,Y] = meshgrid(vec);
Z = X+i*Y;
surf(X,Y,fphase(Z))
view(2)
Reminder from one year ago:
The function angle(p(z)) is discontinuous where p(z) is real-valued and <= 0.
By solving p(z) = x for z (x real-valued) and restricting x to non-positive values in the plot, we find the curves where angle(p(z)) is discontinuous.
syms z x
p = (-0.1540 + 0.2600*1i)+ ( 0.4347 + 0.0914*1i)*z+( 0.7756 - 0.4566*1i)*z.^2;
assume(x,'real')
ps = p - x;
sol = solve(ps==0,z);
rsol1 = matlabFunction(real(sol(1)));
isol1 = matlabFunction(imag(sol(1)));
rsol2 = matlabFunction(real(sol(2)));
isol2 = matlabFunction(imag(sol(2)));
x = -10:0.1:0;
hold on
plot(rsol1(x),isol1(x),'o')
plot(rsol2(x),isol2(x),'x')
hold off
grid on
Yes, Sorry for that I know you all provided me with a very good explanation,
but because I read this discontinuity happens because the tan function is a multi-valued function and I find myself with a confious issue.
I understand your explanation that this discontinuity happens at the value where f_k(z) is real and negative. My question is why the discontinuity happens at these points?
Many thanks for all help
but because I read this discontinuity happens because the tan function is a multi-valued function and I find myself with a confious issue.
I'd also be confused if I would have read this. It's not the "tan" function, but the "atan2" function that has this discontinuity:
My question is why the discontinuity happens at these points?
Because atan2 is discontinous for those z values where f_k(z) is real and non-positive.

Sign in to comment.

Answers (0)

Categories

Asked:

on 18 Sep 2023

Commented:

on 19 Sep 2023

Community Treasure Hunt

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

Start Hunting!