Wavetip detection (contour related issue)

3 views (last 30 days)
Harry
Harry on 27 May 2014
Commented: Star Strider on 27 May 2014
I have a spiral shaped propagating wave. The spiral likes to walk around a bit. I'd like to quantify this. The wave front is very sharp and the contours are close together. The wave back is flatter and the contours are more spread apart. I'd like to find where these two collide (the wave tip). Contour plot is working nicely (see fantastic High Definition picture remastered in Paint). What I'd like to do is use whatever contour plot uses to calculate the contour lines so I can find when the lowest two contour lines (at values 0.1 and 0.2) are a certain distance from each other. Is there a way to use contour plot and instead of plotting the contours, obtain the data used to plot it so I can do some of my own analysis on the lines?
Thanks to anyone that can provide any assistance!

Answers (1)

Star Strider
Star Strider on 27 May 2014
If you used MATLAB to plot the contour plot in the image you posted, you can use the same data to plot a surface (the surfc or meshc plots would likely be most approptiate). Look at the plotted surface and see if that suggests an approach.
You might also consider the gradient function to determine the amplitude of changes in the surface, inflection points, and other areas-of-interest.
  2 Comments
Harry
Harry on 27 May 2014
Thank you for your answer. I did use MATLAB and the contour plot is animated. I took a screenshot of the youtube upload of the movie file, hence the rubbish resolution. I also have a rather pretty animated heat map - spiral initiated after 12 seconds https://www.youtube.com/watch?v=lngvomIUhNI. I stopped using surfc after it almost gave me a seizure for a chaotic solution.
Finding the gradient (pcolour posted) seems to be a step in the right direction, which seems easier. The task now is a simple 'find where the red line ends'. If I could get the numerical data of the contour line half way up (a green coloured value) I could find its point of maximum curvature easily enough. MATLAB must be able to find this data, otherwise it wouldn't be able to plot contours. I just need a function that's basically contour plot without the plot, to just give me the data of the line its about to plot instead of plotting it so I can find and maximise curvature. Thanks a lot for your suggestions, I don't know why I didn't think of plotting the gradient.
Star Strider
Star Strider on 27 May 2014
My pleasure!
I don’t know what your data are, but if you have the coordinates of the values that define the red line (maximum value, zero gradient, or however you define it), follow progressively increasing increasing incremental angles between the adjacent x and y coordinates as the curve radius becomes less. One possibility might be diff(atan2(diff(y),diff(x))) or perhaps even abs() of it. Where that value is maximum is likely close to the end of the red line.
This assumes that you can isolate the coordinates of the red line with enough precision to make that option realistic. If your data are noisy, that might not be applicable.
This is an example of the strategy I can’t adequately describe otherwise:
crvx = t.*cos(t);
crvy = t.*sin(t);
dvx = -diff([0 crvx]);
dvy = -diff([0 crvy]);
figure(1)
plot(crvx, crvy, '-b')
hold on
quiver(crvx,crvy, dvx,dvy, 'r')
% plot(dvx, dvy, '-r')
hold off
grid
I defined the curve as starting from the center and diverging, so the reason for the negative values for ‘dvx’ and ‘dvy’. Make appropriate changes for your data.

Sign in to comment.

Categories

Find more on Contour Plots 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!