Re: Re: Re: 3d plots in mathematica 5.0
- To: mathgroup at smc.vnet.net
- Subject: [mg59175] Re: [mg59127] Re: [mg59124] Re: 3d plots in mathematica 5.0
- From: "David Park" <djmp at earthlink.net>
- Date: Sun, 31 Jul 2005 01:30:46 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
In this particular case we can parametrize the contour surfaces. Looking for the constant values surface, we obtain a simplification to ellipsoids. Exp[-2*(x^2 + y^2/r0^2)]*Exp[-2*(z^2/z0^2)] == c Simplify[%] % /. x^2 + y^2/r0^2 + z^2/z0^2 -> k2 Solve[%, k2][[2,1]] krule = % /. k2 -> k^2 Write the equation for the constant value ellipsoid in terms of contour value c. x^2 + y^2/r0^2 + z^2/z0^2 == k^2 % /. krule (Distribute[#1/(-Log[c]/2)] & ) /@ % Standard parametrization of an ellipsoid (from Alfred Gray, Modern Differential Geometry).... ellipsoid[a_, b_, c_][u_, v_] := {a Cos[v]Cos[u], b Cos[v]Sin[u], c Sin[v]} Writing a definition for the parametrization of a gauss contour surface... ellipsoid[k, k*r0, k*z0][u, v] gausscontour[r0_, z0_, c_] = % /. k -> Sqrt[-Log[c]/2] This plots a cut-a-way of the surface for given values.... ParametricPlot3D[ gausscontour[1.4, 1.4, 0.1] // Evaluate, {u, 0, 6/4Pi}, {v, -Pi/2, Pi/2}, PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}}2]; The following uses the DrawGraphics package from my web site and plots a series of such surfaces. Needs["DrawGraphics`DrawingMaster`"] Draw3DItems[ {MapThread[{SurfaceColor[#2], EdgeForm[ColorMix[#2, Black][0.3]], ParametricDraw3D[ gausscontour[1.4, 1.4, #1] // Evaluate, {u, 0, 6/4Pi}, {v, -Pi/2, Pi/2}]} &, {{0.1, 0.2, 0.5, 0.7, 0.9}, {CyanWhite, LightSkyBlue, DodgerBlue, RoyalBlue, Blue}}]}, NeutralLighting[0.3, 0.5, 0.1], PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}}2, PlotLabel -> SequenceForm[ "Constant Gaussian Surfaces for\n ", {0.1, 0.2, 0.5, 0.7, 0.9}], BoxStyle -> Gray, Background -> Linen, ImageSize -> 500]; David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ From: David Annetts [mailto:davidannetts at aapt.net.au] To: mathgroup at smc.vnet.net Hi Fiz, > > Here is the function > > w=exp(-2(x^2+y^2/r0^2))*exp(-2(z^2/z0^2)) > > r0=1.4 and z0=1.4 The function is Exp, not exp, and it needs square brackets not parentheses. r0 = 1.4; z0 = 1.4; w = Exp[(-2(x^2 + y^2/r0^2))]*Exp[(-2(z^2/z0^2))] // FullSimplify The function you're after is ContourPlot3D, and you use it like Needs["Graphics`ContourPlot3D`"] ContourPlot3D[w, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}, Contours -> {.75}, \ PlotRange -> All, Axes -> True, BoxRatios -> {1, 1, 1}]; This produces "something", but it's not (IMHO) particularly useful or informative. You might get better value from either animating the 3D plot or another approach. Dave.