I find myself unable to make a 3D plot of the atomic
2p orbital
f_z(2p,x,y,z;a)=z*Exp[-a*Sqrt[x^2+y^2+z^2]].
As far as I can understand, 'ContourPlot3D' is the
only option, but it gives either an empty plot box or
a flat sheet.
Can anyone suggest a way out?
Best regards,
Henning Heiberg-Andersen
>I find myself unable to make a 3D plot of the atomic 2p orbital
>f_z(2p,x,y,z;a)=z*Exp[-a*Sqrt[x^2+y^2+z^2]].
>As far as I can understand, 'ContourPlot3D' is the only option, but
>it gives either an empty plot box or a flat sheet.
>Can anyone suggest a way out?
You did not make it clear exactly what you tried to plot. If it was the expression you posted, then try re-writting your function as
f[x_, y_, z_, a_] := z*Exp[-a*Sqrt[x^2 + y^2 + z^2]]
Here, I've eliminated the _z from the function name as Mathematica doesn't allow underscore characters in function names f_z is interpeted by Mathematica to be any expression with Head z given a name f, not what you want.
Changed the "(" to "[" to corespond to proper Mathematica syntax
dropped 2p from the arguements since it does not appear on the rhs
added a underscore to all of the other arguments. Using x_ is interpreted by Mathematica as being any valid expression and is given a local name of x
Replaced Set ("=") with DelayedSet (":=")
--
To reply via email subtract one hundred and four
<<Graphics`ContourPlot3D`
fz[x_,y_,z_,a_]:=z*Exp[-a*Sqrt[x^2+y^2+z^2]]
ContourPlot3D[Abs[fz[x,y,z,1]]-0.3,{x,-1.5,1.5},{y,-1.5,1.5},{z,-3,3},
PlotPoints->{7,7}];
Comments:
1. Your notation for the 2p orbital function (the left hand side of your
definition) could not possibly have worked in Mathematica so I have
rewritten it.
2. The surface in ContourPlot3D is defined as Abs[fz[x,y,z,1]]-0.3 == 0.
I have used Abs so you get both of the lobes of the 2p orbital in the same
plot.
3. PlotPoints->{7,7}] gives you sufficient resolution for a good quality
plot. If the resolution is set too low then the plot might not appear at
all!
4. Play around with the various parameters to get whatever plot you
actually want.
Steve Luttrell
"Henning Heiberg-Andersen" <Henning.Heib...@fi.uib.no> wrote in
message news:cm20mr$g60$1...@smc.vnet.net...
If 'Cos' is replaced by 'Cosh' in the command
ContourPlot3D[Cos[Sqrt[x^2+y^2+z^2]],{x,-2,2},{y,0,2},{z,-2,2}]
an empty plot box appears.
It seems to me that it is problematic to make 3D contour plots
involving exponential functions, and I hope somebody can suggest
a remedy for this.
Best regards,
Henning Heiberg-Andersen
On Sun, 31 Oct 2004, Bill Rowe wrote:
> On 10/30/04 at 3:47 AM, Henning.Heib...@fi.uib.no (Henning
> Heiberg-Andersen) wrote:
>
> >I find myself unable to make a 3D plot of the atomic 2p orbital
>
> >f_z(2p,x,y,z;a)=z*Exp[-a*Sqrt[x^2+y^2+z^2]].
>
> >As far as I can understand, 'ContourPlot3D' is the only option, but
> >it gives either an empty plot box or a flat sheet.
>
> >Can anyone suggest a way out?
>
Taking f_z=1, x^2+y^2 = r^2 for rotational symmetry, it seems possible
in a limited z interval due to sqrt and log.
a = 1 ; r = Sqrt[ (Log[z]/a)^2 - z^2];
ParametricPlot3D [{r Cos[th], r Sin[th], z}, {z, -1, 1}, {th, 0, 2
Pi}, PlotPoints -> {23, 21}]
You also get an empty box if you replace Cos[...] with 1-Cos[...], simply because 1-Cos[...] is never zero in the range. But this gives a surface:
ContourPlot3D[3 - Cosh[Sqrt[
x^2 + y^2 + z^2]], {x, -2, 2}, {y, 0, 2}, {z, -2, 2}]
and so does this:
ContourPlot3D[1.01 - Cosh[Sqrt[x^2 + y^2 +
z^2]], {x, -2, 2}, {y, 0, 2}, {z, -2, 2}]
That's a weird one.
Bobby
On Mon, 1 Nov 2004 02:53:19 -0500 (EST), Henning Heiberg-Andersen <Henning.Heib...@fi.uib.no> wrote:
>
>
>
> I am sorry that I was not clear enough about the nature of my problem,
> which I will try to illustrate by the following example:
>
> If 'Cos' is replaced by 'Cosh' in the command
>
> ContourPlot3D[Cos[Sqrt[x^2+y^2+z^2]],{x,-2,2},{y,0,2},{z,-2,2}]
>
> an empty plot box appears.
>
> It seems to me that it is problematic to make 3D contour plots
> involving exponential functions, and I hope somebody can suggest
> a remedy for this.
>
> Best regards,
> Henning Heiberg-Andersen
>
> On Sun, 31 Oct 2004, Bill Rowe wrote:
>
>> On 10/30/04 at 3:47 AM, Henning.Heib...@fi.uib.no (Henning
>> Heiberg-Andersen) wrote:
>>
>> >I find myself unable to make a 3D plot of the atomic 2p orbital
>>
>> >f_z(2p,x,y,z;a)=z*Exp[-a*Sqrt[x^2+y^2+z^2]].
>>
>> >As far as I can understand, 'ContourPlot3D' is the only option, but
>> >it gives either an empty plot box or a flat sheet.
>>
>> >Can anyone suggest a way out?
>>
>> You did not make it clear exactly what you tried to plot. If it was the expression you posted, then try re-writting your function as
>>
>> f[x_, y_, z_, a_] := z*Exp[-a*Sqrt[x^2 + y^2 + z^2]]
>>
>> Here, I've eliminated the _z from the function name as Mathematica doesn't allow underscore characters in function names f_z is interpeted by Mathematica to be any expression with Head z given a name f, not what you want.
>>
>> Changed the "(" to "[" to corespond to proper Mathematica syntax
>>
>> dropped 2p from the arguements since it does not appear on the rhs
>>
>> added a underscore to all of the other arguments. Using x_ is interpreted by Mathematica as being any valid expression and is given a local name of x
>>
>> Replaced Set ("=") with DelayedSet (":=")
>> --
>> To reply via email subtract one hundred and four
>>
>>
>
>
>
>
a) learn the correct syntax, i.e,
fz[a_]["2p",x_,y_,z_]=z*Exp[-a*Sqrt[x^2+y^2+z^2]]
b) set the Contours option in ContourPlot3D[] to an non zero value
Regards
Jens
"Henning Heiberg-Andersen" <Henning.Heib...@fi.uib.no> schrieb im
Newsbeitrag news:cm20mr$g60$1...@smc.vnet.net...
> I find myself unable to make a 3D plot of the atomic
> 2p orbital
>
> f_z(2p,x,y,z;a)=z*Exp[-a*Sqrt[x^2+y^2+z^2]].
>
> As far as I can understand, 'ContourPlot3D' is the
> only option, but it gives either an empty plot box or
> a flat sheet.
>
> Can anyone suggest a way out?
You may find the article "Visualizing Atomic Orbitals" by Jingbo Wang,
Paul Abbott, and Jim Williams, available in Notebook form (with and
without graphics) at
http://physics.uwa.edu.au/pub/Orbitals
relevant.
Cheers,
Paul
--
Paul Abbott Phone: +61 8 6488 2734
School of Physics, M013 Fax: +61 8 6488 1014
The University of Western Australia (CRICOS Provider No 00126G)
35 Stirling Highway
Crawley WA 6009 mailto:pa...@physics.uwa.edu.au
AUSTRALIA http://physics.uwa.edu.au/~paul