Message Boards Message Boards

0
|
2505 Views
|
4 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Plot works but RevolutionPlot3D fails with Nonrectangular tensor encounterd

Posted 2 years ago

Why does the Plot work but the RevolutionPlot3D fail?

POSTED BY: James Bowery
4 Replies

James,

RevolutionPlot3D has the attribute HoldAll, so - just to avoid the error message - the argument needs to be evaluated:

RevolutionPlot3D[Evaluate[z /. OblateSpheroidProfile[r0, r]], {r, 0, r0}]

But I guess the output is not what you are expecting ...

If you would rather like to see a sphere, you need two functions to be "rot-plotted", e.g. like so:

yFuncts = z /. OblateSpheroidProfile[r0, r];
functs = {r, #} & /@ yFuncts;
RevolutionPlot3D[Evaluate@functs, {r, 0, r0}]

enter image description here

Addendum: We get the same result by putting both of your original functions into a seperate List:

functs1 = List /@ (z /. OblateSpheroidProfile[r0, r]);
RevolutionPlot3D[Evaluate[functs1], {r, 0, r0}, BoxRatios -> {1, 1, 1}]

This is somewhat simpler and more intuitive.

POSTED BY: Henrik Schachner
Posted 2 years ago

Thanks.

But I'm curious as to why RevolutionPlot3D produces an upside down cone rather than the expected surface of rotation of a semicircle/semielipse.

POSTED BY: James Bowery

But I'm curious as to why RevolutionPlot3D produces an upside down cone ...

This is because yFuncts is interpreted as a single two dimensional function, i.e. when it it plotted as such, it gives a straight line:

yFuncts = z /. OblateSpheroidProfile[r0, r];
ParametricPlot[yFuncts, {r, 0, r0}]

This line is then rotated around the z-axis. Have a look at the examples in the documentation on RevolutionPlot3D.

POSTED BY: Henrik Schachner
Posted 2 years ago

So I take it that also somehow explains why this produces an inverted cone?

RevolutionPlot3D[Evaluate[z /. OblateSpheroidProfile[r0, r]], {r, 0, r0}]
POSTED BY: James Bowery
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract