0
$\begingroup$

I'm trying to use NMinimize to solve the 4th question of Hundred-dollar, Hundred-digit Challenge problems

What is the global minimum of the function $\exp(\sin(50x))+\sin(60e^y)+\sin(70\sin x)+\sin(\sin(80y))-\sin(10\left(x+y\right))+1/4\left(x^2+y^2\right)$ ?

The mathematica codes are as following:

f[x_, y_] := 
 Exp[Sin[50 x]] + Sin[60  Exp[y]] + Sin[70  Sin[x]] + Sin[Sin[80 y]] -
   Sin[10 (x + y)] + (x^2 + y^2)/4

NMinimize[f[x, y], {x, y}]

The above codes give the correct answer {-3.30687, {x -> -0.0244036, y -> 0.210625}}

However, when I tried to specify the option WorkingPrecision to obtain a higher precision answer, NMinimize gave me a wrong answer:

NMinimize[f[x, y], {x, y}, WorkingPrecision -> 30]

(*{-3.14407941031143614721780738981, {x -> -0.0231677594567431947167213562978, 
  y -> -0.494212878682625029250540893094}}*)

So how to obtain the true answer when specifying the WorkingPrecision option?

$\endgroup$

1 Answer 1

0
$\begingroup$

Use different Method:

NMinimize[f[x, y], {x, y}, WorkingPrecision -> 30, 
 Method -> "DifferentialEvolution"]
(* or *)
NMinimize[f[x, y], {x, y}, WorkingPrecision -> 30, 
 Method -> {"RandomSearch", "SearchPoints" -> 500}]

(* {-3.30686864747523728007611377090, 
    {x -> -0.0244030796943751719036133083297, 
     y -> 0.210612427155355770591591100555}} *)

Suggested reading: Numerical Nonlinear Global Optimization.

$\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.