0
$\begingroup$

I am trying to solve a relatively simple minimization problem where I can add numerical values to a bunch of my inputs to guess the minimum values:

FullSimplify[Minimize[1/2 (1 - mz^2) + HD/2 (mx^2) - HEXT mz +
HS/2 (mz^2 - my^2) /. {HD -> 100, HEXT -> 5, HS -> hs}, {mx, my, 
mz} \[Element] Sphere[]]]

which returns values for mx, my, mz from which I can guess the minimum symbolically. But if I remove the numbers I provide for HD and HEXT values and try to the following the calculation takes forever.

FullSimplify[Minimize[1/2 (1 - mz^2) + HD/2 (mx^2) - HEXT mz +
HS/2 (mz^2 - my^2) /. {HD -> HD, HEXT -> HEXT, HS -> hs}, {mx, my, 
mz} \[Element] Sphere[]]]

Am I overlooking a generalization or is there a way to make Mathematica produce the minimum symbolically?

$\endgroup$
  • $\begingroup$ In general, no. There are some very simple expressions that work like Minimize[(x - a)^2 (y - b)^2, {x, y}] but in general you must treat the constants as 'first order'. Even this extraordinarily simple example doesn't work Assuming[a \[Element] Reals, Minimize[Cos[a x]^2, x]] $\endgroup$ – flinty Jun 19 at 22:50
  • $\begingroup$ 1. Just checking that you really mean a Sphere, i.e. the surface only, and not a Ball. 2. If your points are limited to the surface of a sphere, maybe a change to spherical coordinates could make the problem simpler (the radius would be constant in that coordinate system, so you would be reducing the complexity a bit). $\endgroup$ – MarcoB Jun 20 at 0:42
  • $\begingroup$ @MarcoB you are right that I mean a Sphere, the surface. Yes, spherical coordinates in general could help but they introduce other problems. For example, Cos[theta] when theta is zero makes it very hard to define the phi since there are a multiplicity of solutions. Minimize[] performs better with Cartesian coordinates in my experience. $\endgroup$ – YNSBRYR Jun 20 at 17:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.