How can I plot the streamlines in all region around the inside sphere ?
Show older comments
Accepted Answer
More Answers (1)
Shreen El-Sapa
on 7 Jan 2024
0 votes
6 Comments
Star Strider
on 7 Jan 2024
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
on 7 Jan 2024
Shreen El-Sapa
on 7 Jan 2024
Star Strider
on 8 Jan 2024
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
on 8 Jan 2024
Star Strider
on 8 Jan 2024
As always, my pleasure!
Categories
Find more on Polygons in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


