### 1.10 Direction-set (Powell’s) method

Function File: [p, obj_value, convergence, iters, nevs] = powell (f, p0, control)

  Multidimensional minimization (direction-set method). Implements a direction-set (Powell’s) method for multidimensional minimization of a function without calculation of the gradient [1, 2]

  #### Arguments

  - f: name of function to minimize (string or handle), which should accept one input variable (see example for how to pass on additional input arguments)
  - p0: An initial value of the function argument to minimize
  - options: an optional structure, which can be generated by optimset, with some or all of the following fields:
    - - MaxIter: maximum iterations (positive integer, or -1 or Inf for unlimited (default))
    - - TolFun: minimum amount by which function value must decrease in each iteration to continue (default is 1E-8)
    - - MaxFunEvals: maximum function evaluations (positive integer, or -1 or Inf for unlimited (default))
    - - SearchDirections: an n*n matrix whose columns contain the initial set of (presumably orthogonal) directions to minimize along, where n is the number of elements in the argument to be minimized for; or an n*1 vector of magnitudes for the initial directions (defaults to the set of unit direction vectors)

  #### Examples

      y = @(x, s) x(1) ^ 2 + x(2) ^ 2 + s;
      o = optimset('MaxIter', 100, 'TolFun', 1E-10);
      s = 1;
      [x_optim, y_min, conv, iters, nevs] = powell(@(x) y(x, s), [1 0.5], o); %pass y wrapped in an anonymous function so that all other arguments to y, which are held constant, are set
      %should return something like x_optim = [4E-14 3E-14], y_min = 1, conv = 1, iters = 2, nevs = 24

  #### Returns:

  - p: the minimizing value of the function argument
  - obj_value: the value of f() at p
  - convergence: 1 if normal convergence, 0 if not
  - iters: number of iterations performed
  - nevs: number of function evaluations

  #### References

  1. Powell MJD (1964), An efficient method for finding the minimum of a function of several variables without calculating derivatives, Computer Journal, 7 :155-162
  2. Press, WH; Teukolsky, SA; Vetterling, WT; Flannery, BP (1992). Numerical Recipes in Fortran: The Art of Scientific Computing (2nd Ed.). New York: Cambridge University Press (Section 10.5)