0
$\begingroup$

I am trying to find, analytically, the $\theta,\phi$ that minimize the function U($\theta,\phi$)

Clear[h, d]
m = {Sin[θ] Cos[ϕ], Sin[θ] Sin[ϕ], Cos[θ]};
n = {Sin[θn] Cos[ϕn], Sin[θn] Sin[ϕn],Cos[θn]};
H = h {0, 0, 1};
U = -H.m - d (n.m)^2

where h and d are positive. θn and ϕn are fixed variables.

How can I find the value of $\theta,\phi$ that minimizes U($\theta,\phi$)?

I tried to use

Minimize[{U, h > 0, d > 0}, {θ, ϕ}]

It is not successful, Mathematica just returns the input as the output.

What is the proper way of doing this problem?


Update

I solved it manually. $dU/d\phi=0$ leads to $\phi=\phi_n$ or $\pi+\phi_n/\pi$, and, therefore, $dU/d\theta=0$ gives the equation for $\theta$ as

$\qquad h\sin\theta+d\sin[2(\theta\pm\theta_n)]=0$

Mathmematica is able to give a long analytical solution. I have to use a numerical result for given values of d,h,$\theta_n$, $\phi_n$.

$\endgroup$
  • $\begingroup$ Is: θn or: θ*n ? $\endgroup$ – Mariusz Iwaniuk Nov 8 at 20:41
  • $\begingroup$ θn is $\theta_n$, θn and ϕn are fixed variables $\endgroup$ – p.s Nov 8 at 20:47
  • 1
    $\begingroup$ The minimum should be a root of $\nabla U$, and you can see that there is no closed-form solution in general. $\endgroup$ – anderstood Nov 8 at 22:22
  • $\begingroup$ you mean there is no analytical solution? $\endgroup$ – p.s Nov 8 at 22:43
  • 1
    $\begingroup$ How can you get a numerical result if some parameters are symbolic? $\endgroup$ – Daniel Lichtblau Nov 9 at 15:41
1
$\begingroup$

Evidently it's having trouble with the transcendental equation. Plug in values and it can do it numerically.

d = .5
h = .5
θn = 45 °
ϕn = 30 °

Minimize[U, {θ, ϕ}]
(*{-0.899519, {θ -> 0.523599, ϕ -> 0.523599}}*)

You need to test your own values, since I don't know what reasonable input value are.

$\endgroup$
  • $\begingroup$ Ideally, I hope to get an analytical solution. If there is no analytical one, I will have to use the numerical one. $\endgroup$ – p.s Nov 8 at 22:42
  • $\begingroup$ I can't see why this should have been down-voted $\endgroup$ – mikado Nov 9 at 11:50
  • 1
    $\begingroup$ If you use exact values for d and h (i.e., 1/2) the minimum is {1/8 (-2 - 3 Sqrt[3]), {\[Theta] -> \[Pi]/6, \[Phi] -> \[Pi]/6}} and {1/8 (-2 - 3 Sqrt[3]), {\[Theta] -> (11 \[Pi])/6, \[Phi] -> (7 \[Pi])/ 6}} $\endgroup$ – Bob Hanlon Nov 9 at 14:32

Not the answer you're looking for? Browse other questions tagged or ask your own question.