필터 지우기
필터 지우기

How do i plot these kind of surfaces?

조회 수: 1 (최근 30일)
simran
simran 2023년 8월 28일
댓글: simran 2023년 9월 2일
I want to plot a surface with coordinates (re(x_1(z)),im(x_2(z)),2*Im(x_3(z));
where x_1(z),x_2(z),x_3(z) are any functions of z and 'z' is a complex variable such that |z|<1, i.e, z belongs to unit disk. Also,"Re" and "Im" stands for real and imaginary part of the respective complex function.
i want to plot surfaces like this in MATLAB, as done in the above tool. Also, i wanted to understand the significance of the above theta min and theta max setup. why not just put 0 to 2*pi ? How will we know what to set pi/24 or pi/32? so, out of curiosity hen i put 0 to 2*pi, the picture looks absurd like this as shown in the picture attached below? Please tell me how to draw these in MATLAB (with better colors) and the significance of theta min and theta max.
I'll be so grateful for any kind of help.

채택된 답변

Dyuman Joshi
Dyuman Joshi 2023년 8월 29일
It shows in the image to take the real part of the functions, but your description says something different.
The code below is according to the image as reference -
"Please tell me how to draw these in MATLAB (with better colors)"
You figured out using fsurf, for colors, experiment with colormap, choose the one you like the most.
syms z r theta
X(z) = real(-i/2*log((1+z*i)/(1-z*i)));
Y(z) = real(-i/2*log((1+z)/(1-z)));
Z(z) = real(1/2*log((1+z^2)/(1-z^2)));
X(r,theta)=subs(X,z,r*exp(1i*theta));
Y(r,theta)=subs(Y,z,r*exp(1i*theta));
Z(r,theta)=subs(Z,z,r*exp(1i*theta));
fsurf(X,Y,Z,[0 1 pi/24 2*pi+pi/24],'MeshDensity',150,'LineStyle','none')
colormap(cool)
%Adjust x, y and z axis limits according to the reference image
axis([-1 1 -1 1 -1 1])
"Also, i wanted to understand the significance of the above theta min and theta max setup."
The values provided are used to calculate the values of X, Y and Z functions and then the values are used to plot the function. The plot will be according to the values provided, if no values are provided, default values are used.
"How will we know what to set pi/24 or pi/32?"
You can choose anyvalue, as using [value 2*pi+value] is equivalent to using [0 2*pi]. (I don't know the reason why the image you got for [0 2*pi] is so different from [pi/24 2*pi+pi/24])
See the below plot and compare it to the above plot -
figure
fsurf(X,Y,Z,[0 1 0 2*pi],'MeshDensity',150,'LineStyle','none')
colormap(cool)
axis([-1 1 -1 1 -1 1])
You can also compare the data, which you can get from the handle of fsurf().
  댓글 수: 3
Dyuman Joshi
Dyuman Joshi 2023년 8월 30일
"You've just pasted my code with just axis command in addition."
No, I have made other changes and gave explainations as well, which you have overlooked.
"And it doesn't answer my whole question about what role does theta play"
I did. You seem to have skipped over it -
"Also, i wanted to understand the significance of the above theta min and theta max setup."
The values provided are used to calculate the values of X, Y and Z functions and then the values are used to plot the function. The plot will be according to the values provided, if no values are provided, default values are used.
"why the figure had such drastic changes with setting theta 0 to 2pi?"
I don't know about the software you used to get that figure, but it in MATLAB both figures are the same. Once again, read my answer.
"And how will I know what thetas to set pi/24 or pi/42 or pi/108?"
I answered this as well -
"How will we know what to set pi/24 or pi/32?"
You can choose anyvalue, as using [value 2*pi+value] is equivalent to using [0 2*pi]
simran
simran 2023년 9월 2일
ok, Thanks!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Abderrahim. B
Abderrahim. B 2023년 8월 28일
Hi!
You may want to try surf function, and customize the plot to get a similar one to what you have posted. If you want to plot and interact with your plot use MATLAB app designer.
Hope this helps
-AB
  댓글 수: 4
simran
simran 2023년 8월 28일
편집: Voss 2023년 8월 28일
I had x_1,x_2, x_3 as symbolic functions of z. Then i put the following, I'm not sure if it's correct. Plus I don't know what theta to set as min max so that it shows a better picture. What does that do?
syms r; syms theta;
x_1(r,theta)=subs(x_1,z,r*exp(1i*theta))
x_2(r,theta)=subs(x_2,z,r*exp(1i*theta))
x_3(r,theta)=subs(x_3,z,r*exp(1i*theta))
fsurf(real(x_1),imag(x_2),2*imag(x_3),[0 0.9999 pi/24 2*pi+pi/24],'MeshDensity',200,'ShowContours','on')
Dyuman Joshi
Dyuman Joshi 2023년 8월 29일
@simran please check my answer.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by