I would like to perform a 2D electrostatic minimization between two charged ellipsoids, provided that they should not penetrate each other; they can touch but they are hard ellipsoids. Here is what I have done, but I get some error-warning messages.
U
is the electrostatic potential and by defining Δ
and δ
, I defined the relative displacement of the ellipsoids relative to each other in x
and y
directions. One ellipsoid is fixed at the origin. Then I defined two regions ℛ1
and ℛ2
where the distance between them should be positive to prevent them penetrating each other.
Did I make mistake when passing the values of these relative displacements, Δ
and δ
, to the Ellipsoid
function?
R1 = 4.15;
ρ = 3.3;
R = R1 ρ^(-(1/3));
e1 = Sqrt[1 - 1/ρ^2];
Eex = 100;
p = Sqrt[Eex*0.385177788];
d = R Sqrt[3/5 (ρ^2 - 1)];
q = p/(2 d);
ϵ = 1;
pre = q^2/(4 π ϵ);
r1 = Sqrt[Δ^2 + (2 d + δ)^2];
r2 = Sqrt[Δ^2 + δ^2];
r3 = Sqrt[Δ^2 + (4 d + δ)^2];
U = pre (2/r1 - 1/r2 - 1/r3);
ℛ1 = Ellipsoid[{0, 0}, {R, ρ*R}];
ℛ2 = Ellipsoid[{Δ, 2 d + δ}, {R, ρ*R}];
FindMinimum[{U && MinValue[EuclideanDistance[x, y], {x ∈ ℛ1, y ∈ ℛ2}] > 0}, {Δ, δ}]
FindMinimum
to a list, rather than a logical combination, and substitutingNMinValue
forMinValue
will at least give you a result, but after many warnings:FindMinimum[{U, NMinValue[EuclideanDistance[x, y], {x ∈ ℛ1, y ∈ ℛ2}] > 0}, {Δ, δ}]
. I think theNMinValue
is struggling mightily here. $\endgroup$