# optimization with user supplied gradient

i want to find a approximate gobal minmum of a nonlinear function . i know the gradient of this function. i find that i can only use Nminimize to achieve this. Although Nminimize offer several Methods(e.g., anneling, evolution) to choose from, none of these support a user supplied gradient. since i have the gradient analytic expression, i want to find a way to take advantage of it, i.e., i want to find an optimization method which support user supplied gradient. But i don't found such function in mma, it only allow this in Findminmum, which only aims to find local minmum.

so my question is 'is there such a global minmization function which allow user supplied gradient in mma?'(while in matlab, one can do this via fmincon)

• All the algorithms used by NMinimize[] are gradient-free, so only FindMinimum[] will be able to take advantage of your separate gradient routine. – J. M.'s ennui Aug 29 '17 at 16:02
• thanks for the comment. just another question: as this function has lots of local minimum, if i use FindMinimum[] with gradient, will i always get stuck in a local minimum? – dr.bian Aug 29 '17 at 16:11
• If you're unlucky at picking starting points, sure... – J. M.'s ennui Aug 29 '17 at 16:28

If you want to do a gradient method, there's no need of a special function. FixedPoint or Nest or NestList or FixedPointList will all work. Say the optimization criterion is crit and the gradient is grad. Then specify a stepsize and iterate:

crit[x_] := (x - 5)^2;
grad[x_] = D[crit[x], x];
mu = 0.01;
initial = 3;
dec = FixedPointList[# - mu*grad[#] &, initial]

ListPlot[dec, PlotRange -> All]


An advantage of this is that you have complete control over initial values, stepsize and convergence criteria (see optional arguments of FixedPointList). If your optimization criterion has many local minima, then you'll want to repeat this from a large number of initial conditions.

• thanks for your answer, l will have to learn how to use fixedpointlist afterwards – dr.bian Aug 29 '17 at 23:30