why the figure of cos function does not symmetric around y axis?

I am tring to describe the figurs of these function .
fk(z) = (0.1000 + 0.3000i) + (0.4243 + 0.0017i)z + (0.9000- 0.0010i)z2
fb(z) = (0.1000 0.3000i)z1 + (0.2121 0.0008i)z2 + (0.9000 +0.0010i)z3
but from the following figurs I faced many question:
1- Why cos(phase(f_k(z))) and cos(phase(f_b(1/z))) not symetric around the y axis?
2 - why there is overlab between the positiv and negative values of cos(phase(f_b(1/z))) in the origin?
3- what is the best points I have to describe them to cover these figures?
I will appriciate any help

4 Comments

The plot for cos(angle(fb(1/z))) seems to be wrong.
Can you show the code how you created the plot ?
I get this:
x = -5:0.005:5;
y = -5:0.005:5;
[X,Y] = ndgrid(x,y);
fb = @(x,y)(0.1000 - 0.3000*1i)*(x+1i*y) + (0.2121 - 0.0008*1i)*(x+1i*y).^2 + (-0.9000 - 0.0010*1i)*(x+1i*y).^3;
Z = cos(angle(fb(X,Y)));
contourf(X,Y,Z)
caxis([-1 1])
colorbar
Why are either expected to be symmetric around the y-axis, by which I presume means symmetric wrt imag(Z)?
fb is written as fb(z), but the question 1 asks about f_b(1/z). f_b(z) and f_b(1/z) are not the same. May be related to Torsten's observation.
Hi all and Thank you very much.
As Torsten asked, I used this code to get the plot both of cos(angle(f_k(z))) and cos(angle(f_b(1/z)))
p=[ ( 0.9000 - 0.0010i) (0.4243 + 0.0017i) (0.1000 + 0.3000i) ];
p1=[(0.9000 + 0.0010i) (0.2121 - 0.0008i) (0.1000 - 0.3000i) (0)] ;
re_z = -6.005:.01:6.005;
im_z= -6.005:.01:6.005;
[re_z,im_z] = meshgrid(re_z,im_z);
z = re_z + 1i*im_z;
f_of_z_result = polyval(p,z);
f_of_1_over_z_result = polyval(p1,1./z);
figure();
subplot(2,2,2)
surf(re_z,im_z,cos(angle(f_of_z_result)),'EdgeColor','none')
colorbar
title('cos(phase of f_k(z))')
xlabel('Z_R')
ylabel('Z_I')
zlim([-5 5]) %adjust this value as needed
caxis([-1 1]) %adjust this value as needed
subplot(2,2,4)
surf(re_z,im_z, cos(angle(f_of_1_over_z_result)),'EdgeColor','none')
colorbar
title(('phase of f(1/z)'))
title(('cos(phase of f_b(1/z))'))
xlabel('Z_R')
ylabel('Z_I')
caxis([-1 1]) %adjust this value as needed
zlim([-1 1]) %adjust this value as needed
grid on
Is this wrong?
and as we know the cos figure is symmetric around y axis, why these figures do not?
I appreciate any help
When I plot these figures in plane I got the previous figures.
Is this wrong?
and as we know the cos figure is symmetric around y axis, why these figures do not?
I appreciate any help

Sign in to comment.

Answers (1)

p=[ ( 0.9000 - 0.0010i) (0.4243 + 0.0017i) (0.1000 + 0.3000i) ];
p1=[(0.9000 + 0.0010i) (0.2121 - 0.0008i) (0.1000 - 0.3000i) (0)] ;
re_z = -6.005:.01:6.005;
im_z= -6.005:.01:6.005;
[re_z,im_z] = meshgrid(re_z,im_z);
figure
z = re_z + 1i*im_z;
f_of_z_result = polyval(p,z);
f_of_1_over_z_result = polyval(p1,1./z);
figure();
subplot(1,2,1)
surf(re_z,im_z,cos(angle(f_of_z_result)),'EdgeColor','none')
colorbar
title('cos(phase of f_k(z))')
xlabel('Z_R')
ylabel('Z_I')
zlim([-5 5]) %adjust this value as needed
caxis([-1 1]) %adjust this value as needed
view(2);
axis tight
subplot(1,2,2)
surf(re_z,im_z, cos(angle(f_of_1_over_z_result)),'EdgeColor','none')
colorbar
title(('phase of f(1/z)'))
title(('cos(phase of f_b(1/z))'))
xlabel('Z_R')
ylabel('Z_I')
caxis([-1 1]) %adjust this value as needed
zlim([-1 1]) %adjust this value as needed
grid on
axis tight
view(2);
1- Why cos(phase(f_k(z))) and cos(phase(f_b(1/z))) not symetric around the y axis?
==> It is a general polynomial and cos(angle(f_x(x+iy))) is in general not equals to cos(angle(f_x(-x+iy))
2 - why there is overlab between the positiv and negative values of cos(phase(f_b(1/z))) in the origin?
==> What do you mean overlap? This is quite a general polynomial and it may not be straightforward to explain how the very nonlinear function cos(phase(f_b(1/z))) behavors.
3- what is the best points I have to describe them to cover these figures?
==> Without criteria given, it is not possible to tell what is the best.

3 Comments

fb(z) = (0.1000 0.3000i)z^1 + (0.2121 0.0008i)z^2 + (0.9000 +0.0010i)z^3
So
fb(1/z) = (0.1000 0.3000i)z + (0.2121 0.0008i)z^2 + (0.9000 +0.0010i)z^3
Thus formally
f_of_1_over_z_result = polyval(p1,z);
in your code, not
f_of_1_over_z_result = polyval(p1,1./z);
Maybe @Aisha Mohamed wrote the above, but meant something else. I don't know.
Thank you Torsten. I find this code is logical and right to me. And I also find the following code from other MATLAB expert logical and right.
This is the other code,
% define the function f(z) in terms of its coefficients p:
% f(z) = z^2-2*z+1
p = [1 -2 1]; % polynomial coefficients p instead of anonymous function f
% evaluate f over all z in ([-1,1],[-1,1]):
f_of_z_result = polyval(p,z);
% evaluate f at 1/z:
f_of_1_over_z_result = polyval(p,1./z);
% plot the magnitude and phase of f(z) and f(1/z):
% (same as before)
figure();
subplot(2,2,1)
surf(re_z,im_z,abs(f_of_z_result),'EdgeColor','none')
title('|f(z)|')
subplot(2,2,2)
surf(re_z,im_z,angle(f_of_z_result),'EdgeColor','none')
title('phase of f(z)')
subplot(2,2,3)
surf(re_z,im_z,abs(f_of_1_over_z_result),'EdgeColor','none')
title('|f(1/z)|')
subplot(2,2,4)
surf(re_z,im_z,angle(f_of_1_over_z_result),'EdgeColor','none')
title('phase of f(1/z)')
I know you are experts and you know what you do, but I am still confuse which code I can use , specially I see some difference in the plot of $ cos(angle(f_b(1/z)) $ between these cods
May be there are some points are different in the two cods , and I could not recognize them
Could you please help me to get thesutible code from them to plot f(z) and f(1/z)?
I will appreciate any help.
Yes, as I suspected: you wrote something, but meant something else.
If you want to plot what is shown in your original graphics for cos(angle(fb(1/z))), you must define fb as
fb(z) = (0.1000 0.3000i)*z + (0.2121 0.0008i)*z^2+ (0.9000 +0.0010i)*z^3,
not as
fb(z) = (0.1000 0.3000i)z1 + (0.2121 0.0008i)z2 + (0.9000 +0.0010i)z3
It's up to you to decide which of the definitions is correct. Depending on your decision, you get different plots.

Sign in to comment.

Tags

Asked:

on 29 Aug 2022

Edited:

on 30 Aug 2022

Community Treasure Hunt

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

Start Hunting!