Particle Trajectories Over Specified Domain

2 Comments

Is the domain over x, y (or both), or over t?
If x and y, then what value does t have?
If over t, then what are the values of x and y?
But why haven't you answered the question "If x and y, then what value does t have?"

Sign in to comment.

Answers (1)

Try this:
numPointsX = 640;
numPointsY = 480;
X = linspace(0, 2, numPointsX);
Y = linspace(0, 2, numPointsY);
[x, y] = meshgrid(X, Y);
t = 1;
z = sin(pi*x) .* sin(pi*y) + 0.3*sin(2*pi*t) .* y;
imshow(z, []);
colormap(hsv(256));
colorbar;
axis('on', 'image');
title('z = sin(pi*x) .* sin(pi*y) + 0.3*sin(2*pi*t) .* y', 'FontSize', 20);

2 Comments

I am trying to use this for a project I am working on, but am interested in following the streamlines starting in either the left or right domain. Is it possible to do this and have the lines beginning in the left be red and the right be blue?
Why don't you either call contour(), or just threshold the image at some level and call bwboundaries()?

Sign in to comment.

Categories

Asked:

on 1 Dec 2019

Commented:

on 5 Dec 2020

Community Treasure Hunt

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

Start Hunting!