Discussion Forum

Plot streamlines in matlab

Topics: MATLAB

Thread index  |  Previous thread  |  Next thread  |  Start a new discussion

RSS FeedRSS feed   |   Email notificationsTurn on email notifications   |   2 Replies   Last post: August 16, 2010 2:36pm UTC
Danial Tz

Danial Tz

July 23, 2010 1:33pm UTC

Plot streamlines in matlab

Hi All,

Does anybody know how to extract velocity field (e.g. laminar flow) and plot streamlines in matlab? I am still playing but no luck so far.

Thanks,
Danial

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Paul Hall

Paul Hall

July 23, 2010 8:35pm UTC in response to Danial Tz

Re: Plot streamlines in matlab

Hi Danial,

I have had luck using the following approach (4.0), though there may be better ways to go about it:

1. Use mpheval command to obtain grid point coordinates and corresponding velocities
2. Use meshgrid command to create regular coordinate grid for plotting
3. Use TriScatteredInterp command to obtain velocities at coordinates generated by meshgrid command
4. Use streamline command to generate and plot streamlines

A little clunky, but it seems to work. If you come up with a better approach, please let me know.

Paul

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Danial Tz

Danial Tz

August 16, 2010 2:36pm UTC in response to Paul Hall

Re: Plot streamlines in matlab


Hi Danial,

I have had luck using the following approach (4.0), though there may be better ways to go about it:

1. Use mpheval command to obtain grid point coordinates and corresponding velocities
2. Use meshgrid command to create regular coordinate grid for plotting
3. Use TriScatteredInterp command to obtain velocities at coordinates generated by meshgrid command
4. Use streamline command to generate and plot streamlines

A little clunky, but it seems to work. If you come up with a better approach, please let me know.

Paul


Hi Paul,

Do you have a code snippet I can check? That will save a lot of time debugging.

Best,
Danial

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse


Rules and guidelines