I'm visualizing some hydrogen like atomic orbitals. For looking at plane slices of the probability density, the DensityPlot
function works well, and with something like:
Manipulate[
DensityPlot[ psi1XYsq[u, v, z], {u, -w, w}, {v, -w, w} ,
Mesh -> False, Frame -> False, PlotPoints -> 45,
ColorFunctionScaling -> True, ColorFunction -> "SunsetColors"]
, {{w, 10}, 1, 20}
, {z, 1, 20, 1}
]
I can get a nice plot
I was hoping that there was something like a DensityPlot3D
so that I could visualize these in 3D, but I don't see such a function. I was wondering how DensityPlot
be simulated using other plot functions, so that the same idea could be applied to a 3D plot to construct a DensityPlot3D
like function?
Answer
In the version 10.2, there is a builtin DensityPlot3D
function, which can be used to visualize orbitals.
a0=1;
ψ[{n_, l_, m_}, {r_, θ_, ϕ_}] :=With[{ρ = 2 r/(n a0)},
Sqrt[(2/(n a0))^3 (n - l - 1)!/(2 n (n + l)!)] Exp[-ρ/2] ρ^
l LaguerreL[n - l - 1, 2 l + 1, ρ] SphericalHarmonicY[l,
m, θ, ϕ]]
DensityPlot3D[(Abs@ψ[{3, 2, 0}, {Sqrt[x^2 + y^2 + z^2],
ArcTan[z, Sqrt[x^2 + y^2]], ArcTan[x, y]}])^2, {x, -10 a0,
10 a0}, {y, -10 a0, 10 a0}, {z, -15 a0, 15 a0},
PlotLegends -> Automatic]
Or use ListDensityPlot3D
:
data = Block[
{nψ =
CompileWaveFunction[ψ[3, 1, 0, r, ϑ, φ]], data, vol},
Table[Abs[nψ[x, y, z]]^2, {z, -20, 20, 0.25}, {y, -20, 20, 0.25}, {x, -20, 20, 0.25}]];
ListDensityPlot3D[data]
The function definition of the wave function is the same as in the other answer in this question.
Comments
Post a Comment