3
$\begingroup$

My first introdcution in mathematica resulted in following plot

Plot3D[(((-0.0023x^2+0.525x+1 )^2)((1-(((z)^2)/((12-((0.0006(180-x)^2-
0.1118*(180-x)+1)) )^2)))^0.5)),{x,0,180},{z,0,16},AspectRatio ->Automatic]

however the result gives me Plot issue. attached the out[] file

Looking for advice on how to solve these mesh issues at different small spots indicated in white. What did i overlooked from math point of view ?

enter image description here

$\endgroup$
6
  • 1
    $\begingroup$ Try: Plot3D[(1 + 0.525 x - 0.0023 x^2)^2 (1 - z^2/(11 + 0.1118 (180 - x) - 0.0006 (180 - x)^2)^2)^0.5, {x, 0, 180}, {z, 0, 17}, AspectRatio -> Automatic, PlotPoints -> 100] $\endgroup$ Mar 31, 2018 at 17:29
  • 3
    $\begingroup$ In addition to increasing the PlotPoints recommend that you use MaxRecursion->5 $\endgroup$
    – Bob Hanlon
    Mar 31, 2018 at 17:49
  • 1
    $\begingroup$ Appreciated a lot $\endgroup$ Mar 31, 2018 at 18:11
  • $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$
    – Michael E2
    Apr 1, 2018 at 2:52
  • $\begingroup$ Cross-posted: community.wolfram.com/groups/-/m/t/1312327 $\endgroup$
    – Michael E2
    Apr 3, 2018 at 17:47

1 Answer 1

1
$\begingroup$

Plot3D, because it samples only in the domain-plane (the xz-plane in the OP), has trouble resolving surfaces with tangents perpendicular to the domain-plane. For functions whose gradients are not very large, Plot3D is usually superior to ContourPlot3D, but in this case, I think ContourPlot3D works better.

Even with the suggestions of PlotPoints -> 100 and MaxRecursion -> 5, there are still some tiny but visible glitches in the surface mesh:

Plot3D[(((-0.0023 x^2 + 0.525 x + 1)^2) *
    ((1 - (((z)^2)/((12 - ((0.0006 (180 - x)^2 - 0.1118*(180 - x) + 1)))^2)))^(1/2))),
  {x, 0, 180}, {z, 0, 16},
  PlotPoints -> 100, MaxRecursion -> 5, AspectRatio -> Automatic, 
  AxesLabel -> Automatic, ImageSize -> Medium, 
  ViewPoint -> {3.215347035920252`, 0.7760554973318896`, 0.7136394773692102`}
  ] // AbsoluteTiming

Mathematica graphics

It is also necessary to square both sides to get rid of the square root. (Sampling outside its domain and possibly rounding errors result in negative numbers under the radical, which causes ContourPlot3D trouble in resolving the surface.)

ContourPlot3D[y^2 == (((-0.0023 x^2 + 0.525 x + 1)^2)^2 *
     ((1 - (((z)^2)/((12 - ((0.0006 (180 - x)^2 - 0.1118*(180 - x) + 1)))^2))))),
  {x, 0, 180}, {z, 0, 16}, {y, 0, 958.5},
  MeshFunctions -> {#1 &, #2 &},
  MaxRecursion -> 2, BoxRatios -> {1., 1., 0.4}, ImageSize -> Medium, 
  ViewPoint -> {3.215347035920252`, 0.7760554973318896`, 0.7136394773692102`}
  ] // AbsoluteTiming

Mathematica graphics

$\endgroup$
2
  • $\begingroup$ Amazing Feedback - the combination of Contourplot , Y square , the level of detail. Appreciated Your contribution a lot. $\endgroup$ Apr 2, 2018 at 10:17
  • $\begingroup$ @user1542889 You're welcome! $\endgroup$
    – Michael E2
    Apr 3, 2018 at 17:48

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.