How can I plot the streamlines in all region around the inside sphere ?
이전 댓글 표시
채택된 답변
추가 답변 (1개)
Shreen El-Sapa
2024년 1월 7일
0 개 추천
댓글 수: 6
Star Strider
2024년 1월 7일
Probably. What do you want to do?
It might be easiest to just mask-out (or cover) the part you do not want (similar to what I did with the centre circle), rather than significantly change the code. That could be done with a patch call (and perhaps some plot calls to connect the otherwise incomplete lines connecting the inner and outer circles).
That is likely easier than changing the original code.
Shreen El-Sapa
2024년 1월 7일
Shreen El-Sapa
2024년 1월 7일
Star Strider
2024년 1월 8일
I assume that you mean the upper half.
Change the final plot code to:
[DK,h4]=contour(x,y,real(psiH),300,'--b');
%[DH1,h1]=contour(x,y,psiH,200,'--b');
hold on
m1=100;
r1=ones(1,m1+1)*a;r2=ones(1,m1+1)./L;
th=[0:2*pi/m1:2*pi];
set(polar(th,r1,'-k'),'LineWidth',1.2);set(polar(th,r2,'-k'),'LineWidth',1.2);
pv = linspace(0, 2*pi*1.01, 250); % Used in 'patch'
cv = [cos(pv); sin(pv)]; % Used in 'patch'
gryval = 0.8; % Controls Shading
patch(cv(1,:), cv(2,:), [1 1 1]*gryval) % Plot 'patch'
xl = xlim + [-1 1]*0.01;
patch([xl flip(xl)], [[1 1]*min(ylim)-0.01 0 0], 'w', 'EdgeColor','none')
plot(xlim, [0 0], '-k')
title('$\eta_1=\eta_2=0.01$','Interpreter','latex','FontSize',12,'FontName','Times New Roman','FontWeight','Normal')
ylabel({'$R_H=0.1$';'$\lambda=2.0$';'$\varphi=1.0$';'$\xi=\xi^{\prime}=0.1$'},'Interpreter','latex','FontSize',12,'rot',360,'FontName','Times New Roman','FontWeight','Normal');
axis('equal')
axis('off')
It plots a white patch object over the lower half of the axes and uses a plot call to draw a black horizontal line on the upper edge of the patch object. That connects the circles.
See if that does what you want.

.
Shreen El-Sapa
2024년 1월 8일
Star Strider
2024년 1월 8일
As always, my pleasure!
카테고리
도움말 센터 및 File Exchange에서 Polygons에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



