0
$\begingroup$

Let us assume that we have a 2D Interpolating function u[x,y]. We can plot its contours by

ContourPlot[u[x,y],{x,xmin,xmax},{y,ymin,ymax}]

But how for given u0 can we extract all points x0,y0 such that u[x0,y0]=u0 in a table form?

$\endgroup$
  • $\begingroup$ I'd say the fact that it's an interpolating function doesn't change anything, you should be able to use the methods here: mathematica.stackexchange.com/q/105750/9490 $\endgroup$ – Jason B. Jan 18 '17 at 15:29
  • $\begingroup$ This may be even more directly what you want. Or this $\endgroup$ – Jason B. Jan 18 '17 at 15:30
  • $\begingroup$ Thank you for your answers. But my main concern is how to get the values x0,y0 ! $\endgroup$ – DK13 Jan 18 '17 at 15:58
  • $\begingroup$ Show an MWE illustrating your issue. With such general statements it's not clear what do you really want. In my opinion, the posted links adresse your issue and provide additional hints allowing to fulfill your needs. If not, then I'm mistaken because your question isn't clear enough. $\endgroup$ – corey979 Jan 18 '17 at 16:01
  • $\begingroup$ @DK13 - look at either of the answers from my second comment, and they say exactly how to get those values. $\endgroup$ – Jason B. Jan 18 '17 at 16:07
0
$\begingroup$
u[x_, y_] := x + y
int = Interpolation @ Catenate @ Table[{{x, y}, u[x, y]}, {x, 0, 1, 0.1}, {y, 0, 1, 0.1}];
u0 = 0.5;
plot = ContourPlot[int[x, y] == u0, {x, 0, 1}, {y, 0, 1}]

enter image description here

Investigating

FullForm[plot]

leads to

pts = Cases[plot, _GraphicsComplex, Infinity][[1, 1]];

ListPlot[pts, PlotRange -> {{0, 1}, {0, 1}}, Frame -> True, AspectRatio -> 1]

enter image description here

The above extracts the deafult number of points used by ContourPlot. To extract more points, add PlotPoints -> 100 (or any other suitable number) as an option to ContourPlot.

See also Generating evenly spaced points on a curve.

$\endgroup$
  • $\begingroup$ thank you! How can we get denser or less denser points? $\endgroup$ – DK13 Jan 18 '17 at 17:38
  • $\begingroup$ Or to homogenize the distance between the various points? $\endgroup$ – DK13 Jan 18 '17 at 17:54

Not the answer you're looking for? Browse other questions tagged or ask your own question.