Alternative 2D Solution
A simpler and more readily generalizable alternative to the solution presented in my previous Answer can be obtained by noting that a UniformDistribution
on the curve shown in the first figure is equivalent to a ProbabilityDistribution
in p
weighted by dsdp
,
ProbabilityDistribution[dsdp/arcmax, {p, 0, 1}]
as can be can be demonstrated by
ListPlot[{#, 2 (1 - #^2)} & /@ RandomVariate[ProbabilityDistribution[dsdp/arcmax, {p, 0, 1}], 100],
AxesLabel -> {p, x}]
which reproduces the second plot in the earlier Answer.
6D Solution (Almost)
Without loss of generality, the full problem can be written after renormalization as
1 == px^2 + py^2 + pz^2 + Sqrt[x^2/4 + y^2/4 + z^2]
Subsequent calculations can be simplified considerably by transforming momentum space to spherical coordinates and configuration space to cylindrical coordinates.
1 == p^2 + Sqrt[z^2 + r^2/4]
where p^2 = px^2 + py^2 + pz^2
and r^2 = x^2 + y^2
. Noting that phase space is mirror-symmetric about all axes, we solve for the surface represented by this equation for {z > 0, r > 0}
.
surface = z /. Assuming[{z > 0, r > 0}, Solve[%, z]][[2]];
Plot3D[surface, {p, 0, 1}, {r, 0, 2}, AxesLabel -> {p, r, s}]
(* Sqrt[4 - 8*p^2 + 4*p^4 - r^2]/2 *)
The differential area of this surface is given by
darea = Sqrt[1 + D[surface, p]^2 + D[surface, r]^2] // Simplify;
and the total area by
area = Integrate[p^2 r darea, {p, 0, 1}, {r, 0, 2 (1 - p^2)}] // N
(Its value is 0.401377.) The resulting probability function is simply
Piecewise[{{p^2 r darea/area, 0 <= r <= 2 (1 - p^2)}}, 0]
Finally, we transform back to the original coordinates to obtain
{px, py, pz, x, y, z} =
{p Sin[θ] Cos[ϕ], p Sin[θ] Sin[ϕ], p Cos[θ], r Cos[ξ], r Sin[ξ],
p Cos[θ], r Cos[ξ], r Sin[ξ], Sqrt[4 - 8*p^2 + 4*p^4 - r^2]/2}
Here, θ
is drawn from
RandomVariate[ProbabilityDistribution[Sin[θ0], {θ0, 0, Pi/2}]]
ϕ
and ξ
are drawn from
RandomVariate[UniformDistribution[{0, Pi/2}]]
and we would like to draw {p, r}
from
RandomVariate[ProbabilityDistribution[
Piecewise[{{p^2 r darea/area, 0 <= r <= 2 (1 - p^2)}}, 0], {p, 0, 1}, {r, 0, 2}]]
Unfortunately, ProbabilityDistribution
cannot handle this expression, as noted in 69150. Presumably, one of the approaches given in 2635 can.
V(x,y,z)
? If not, can you state whetherE = E'
is a continuously differentiable closed surface? $\endgroup$Sqrt
, which causesV
not to be analytical at the origin? I would have expected something likeV [x, y, z] = c ((x^2 + y^2)/(4 a^2) + z^2/a^2)
, analogous to your 1D example. $\endgroup$