2
$\begingroup$

I have a ContourPlot3d shown below. There are some posts (157477) (3015) (19859) that showed how to extract points using a combination of Cases and GraphicsComplex, however, I don't quite understand the structure of their code. To be specific, there are no explanations on how they configured the number of points and the range of how the points are going to be generated.

My goal is to generate data points of the surface, BUT I would like to generate the data points where I can set how many equally spaced points I like, in addition the points should start near the edge of the surface (it doesn't have to start exactly from the range that I set, e.g. tmin, tmax, umin, umax, zmin, zmax). Actually, I do not need so many points, I just need enough points that resembles the plot, that is why I need an option to adjust the number of points and the range. If possible, the data points should be arranged like {{t1,u1,z1},{t2,u2,z2},...} where t1<t2, u1<u2, i.e. from the left side of the plot going to the right side.

u0 = 10;
tmin = 1;
tmax = 20;
umin = 1;
umax = 10;
zmin = 1;
zmax = 10;
mu = (1/u - 1/u0);
int = Integrate[1/(1 - mu z^(d + 1)), z] /. {d -> 3};
plot = ContourPlot3D[u + int - t == 0, {t, tmin, tmax}, {u, umin, umax}, {z, zmin, zmax}, AxesLabel -> {time, u, z}, PlotLegends -> Automatic]

Image

$\endgroup$

2 Answers 2

1
$\begingroup$

The structure of your 3D plot is:

Graphics3D[List[GraphicsComplex[{points,..},...

"points" are the coordinates of the points used. In the rest, these points are referenced only by their index. Therefore, to get at the points, you write:

plot = ContourPlot3D[
  u + int - t == 0, {t, tmin, tmax}, {u, umin, umax}, {z, zmin, zmax},
   AxesLabel -> {time, u, z}, PlotLegends -> Automatic];
points= plot[[1,1,1]];

This gives a list of coordinates. To sort them so that x1<=x2..:

  points= points// Sort;

The first 10 points are:

points[[;;10]]


{{2.46025, 1.07031, 1.}, {2.4623, 1.14063, 1.}, {2.48438, 1.02123, 
  1.}, {2.48438, 1.07031, 1.0563}, {2.48438, 1.14063, 
  1.00504}, {2.48438, 1.20659, 1.}, {2.48631, 1.21094, 1.}, {2.50778, 
  1., 1.}, {2.52253, 1.28125, 1.}, {2.56644, 1.35156, 1.}}
$\endgroup$
2
  • $\begingroup$ How do you add the option of point intervals? For example, 15 equally spaced points in the ‘t’ direction and for each ‘t’ value I would like 20 equally space points running in the u-z direction. $\endgroup$
    – mathemania
    Jan 12 at 2:21
  • 1
    $\begingroup$ You can play with the options "PlotPoints" and "PlotRange" of "ContourPlot". You can not directly specify the points. $\endgroup$ Jan 12 at 9:17
1
$\begingroup$

Try

tuz = Values@FindInstance[{u + int - t == 0, tmin < t < tmax, umin < u < umax,zmin < z < zmax}, {t, u, z}, 20] // N
(*{{12.2783, 9.60909, 2.56815}, {11.3395, 9.35313, 1.94557}, 
{11.2569,9.50157, 1.73819}, {11.1687, 8.36482, 2.35313}, ...}*)
$\endgroup$
2
  • $\begingroup$ In my V.13.0, it generates an error FindInstance::nsmet: The methods available to FindInstance are insufficient to find the requested instances or prove they do not exist. and Values::invrl: The argument FindInstance[{-t+u+(-2 ArcTan[<<1>>]+2 ArcTan[<<1>>]-Log[<<1>>]+Log[Plus[<<3>>]])/(4(2/5+Times[<<2>>])^(1/4))==0,3<t<20,3<u<10,1<z<10},{t,u,z},10] is not a valid Association or a list of rules. Also, why is the order in your result starts at {t1,u1,z1} = {12.2783, 9.60909, 2.56815}? For example, tmin = 1 so it should start near that value not 12.2783. $\endgroup$
    – mathemania
    Jan 11 at 18:24
  • 1
    $\begingroup$ @mathemania MMA v12.2 evaluates without error. The points doesn't lie on a structrured grid. $\endgroup$ Jan 12 at 7:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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