How can I plot Streamline from a stream function?

Hello,
I have a stream function psi = 1.2X^2 + y^2. I have to plot streamline. How can I plot it by using MATLAB?
Thank you.

 Respuesta aceptada

Cris LaPierre
Cris LaPierre el 2 de Abr. de 2021

0 votos

10 comentarios

Alpha Boy
Alpha Boy el 2 de Abr. de 2021
Thank you for your reply. I have tried it but it is not working for the above function. :(
We could probably be of more help if you showed us what you have tried. At a minimum, copy.paste the code as well as any error message it is creating (all the red text).
[x,y] = meshgrid(-3:.5:3,-3:.5:3);
u = 2*y;
v = -2.4*x;
figure
quiver(x,y,u,v)
startx = -3:0.5:3;
starty = ones(size(startx));
streamline(x,y,u,v,startx,starty)
Alpha Boy
Alpha Boy el 2 de Abr. de 2021
[x,y] = meshgrid(-3:.5:3,-3:.5:3);
u = x;
v = -y;
figure
quiver(x,y,u,v)
startx = -3:0.5:3;
starty = ones(size(startx));
streamline(x,y,u,v,startx,starty)
Looks like you got it working. Do you still have a question?
Alpha Boy
Alpha Boy el 2 de Abr. de 2021
How can I remove vector field from this plot? Want to plot only streamline.
Don't include the code that creates them (quiver)
[x,y] = meshgrid(-3:.5:3,-3:.5:3);
u = x;
v = -y;
figure
startx = -3:0.5:3;
starty = ones(size(startx));
streamline(x,y,u,v,startx,starty)
Alpha Boy
Alpha Boy el 2 de Abr. de 2021
Thank you

Iniciar sesión para comentar.

Más respuestas (1)

Categorías

Más información sobre Vector Fields en Centro de ayuda y File Exchange.

Preguntada:

el 1 de Abr. de 2021

Comentada:

el 15 de Abr. de 2025

Community Treasure Hunt

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

Start Hunting!

Translated by