1
$\begingroup$

I'm trying to use FindMaximum to find a local minimum of a simple function.But sometimes it gives me a saddle point. For example,

Clear["Global`*"]
V = -23500 v11^2 + v11^4/2 - 31250 v21^2 + 2 v11^2 v21^2 + v21^4/2 - 
v11^2 v21 v31 - v11 v21^2 v31 - 39000 v31^2 + 2 v11^2 v31^2 - 
v11 v21 v31^2 + 2 v21^2 v31^2 + v31^4/2;
grad = Grad[V, {v11, v21, v31}];
hessian = Grad[grad, {v11, v21, v31}];
m1 = FindMinimum[V, {{v11, 154}, {v21, 0}, {v31, 0}}]
Eigenvalues[hessian /. m1[[2]]]

yields

{-2.76125*10^8, {v11 -> 153.297, v21 -> 0., v31 -> 0.}}
{94000., 48494.9, -994.949}

i tried changing the precision,but it didn't work.Sometimes changing the method to PrincipalAxis will give correct results, but not always. Can someone explain the reason?

$\endgroup$
1
  • $\begingroup$ Try FindMinimum[V, {{v11, 154}, {v21, 0.1}, {v31, 0.1}}, WorkingPrecision -> 16]. $\endgroup$
    – Michael E2
    Commented May 22, 2023 at 6:22

1 Answer 1

5
$\begingroup$
$Version

(* "13.2.1 for Mac OS X ARM (64-bit) (January 27, 2023)" *)

Clear["Global`*"]

V = -23500 v11^2 + v11^4/2 - 31250 v21^2 + 2 v11^2 v21^2 + v21^4/2 - 
   v11^2 v21 v31 - v11 v21^2 v31 - 39000 v31^2 + 2 v11^2 v31^2 - 
   v11 v21 v31^2 + 2 v21^2 v31^2 + v31^4/2;
grad = Grad[V, {v11, v21, v31}];
hessian = Grad[grad, {v11, v21, v31}];

FindMinimum only searches for a local minimum

m1 = FindMinimum[V, {{v11, 154}, {v21, 0}, {v31, 0}}]

(* {-2.76125*10^8, {v11 -> 153.297, v21 -> 0., v31 -> 0.}} *)

Eigenvalues[hessian /. m1[[2]]]

(* {94000., 48494.9, -994.949} *)

Minimize will find a global minimum (but may not necessarily be unique)

m1 = Minimize[V, {v11, v21, v31}, Reals]

(* {-760500000, {v11 -> 0, v21 -> 0, v31 -> -10 Sqrt[390]}} *)

Eigenvalues[hessian /. m1[[2]]] // N

(* {156000., 141013., 61487.4} *)

If the variables are constrained to be nonnegative then

m1 = Minimize[{V, v11 >= 0, v21 >= 0, v31 >= 0}, {v11, v21, v31}, Reals]

(* {-760500000, {v11 -> 0, v21 -> 0, v31 -> 10 Sqrt[390]}} *)

Eigenvalues[hessian /. m1[[2]]] // N

(* {156000., 141013., 61487.4} *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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