1

I'm trying to minimize $ \sum_{k=1}^{6}-(k\sin[(k + 1) x + k])$ , $x\in[-10,10]$ by using the command below.
NMinimize[f[x], {x}, Method -> "SimulatedAnnealing"] This function has 22 minimizes. 3 of them are global minimizers. The result given by mathematica is {-16.5322, {x -> -0.5581}} (one of the global solution).

My question is, how to show all the minimizers by using "SimulatedAnnealing" or other methods such as "RandomSearch"?

1 Answers1

1

NMinimize finds (global) minima. However, you are looking for local minima, i.e. stationary points with positive curvature. So you may want to use

dsum[x_] = D[-Sum[(k Sin[(k + 1) x + k]), {k, 1, 6}], x];
ddsum[x_] = Simplify[D[sum[x], x]];
red = Reduce[sum[x] == 0 \[And] ddsum[x] > 0 \[And] x >= -10 \[And] x <= 10, x];
Length[red]
Apply[List, Map[N[Last[#]] &, red]]

This gives you 22 solutions:

 {-2.518992492757427, -8.802177799937013, 3.764192814422159,-1.6297820274089978, -7.9129673345885845,4.653403279770588, -0.5580997846287081,-6.841285091808294, 5.725085522550878,0.36509927663411146, -5.918086030545474,6.648284583813698, 1.2183337974144448,-5.064851509765141, 7.501519104594031,2.0654526381291416, -4.217732669050445,8.348637945308727, 2.912363387182773,-9.6540072271764,-3.3708219199968132,9.195548694362358}
  • Is that possible to apply simulated annealing but not positive curvature in your code? – user3398803 Apr 26 '17 at 15:27
  • you may also search for minima of Abs[dsum[x]] with these methods, but I'd worry that Mathematica won't find all local minima, hence Reduce appears more appropriate to me –  Apr 26 '17 at 15:36
  • By any chance, do you know how to find all the global minimizers? See linked question for details. – sam wolfe Mar 02 '21 at 15:13