Home > Applications > SpinW > external > fminsearchbnd > sw_fminsearchbnd.m

iFit/sw_fminsearchbnd

PURPOSE ^

FMINSEARCHBND: FMINSEARCH, but with bound constraints by transformation

SYNOPSIS ^

function [x,fval,exitflag,output] = sw_fminsearchbnd(fun,x0,LB,UB,options,varargin)

DESCRIPTION ^

 FMINSEARCHBND: FMINSEARCH, but with bound constraints by transformation
 usage: x=FMINSEARCHBND(fun,x0)
 usage: x=FMINSEARCHBND(fun,x0,LB)
 usage: x=FMINSEARCHBND(fun,x0,LB,UB)
 usage: x=FMINSEARCHBND(fun,x0,LB,UB,options)
 usage: x=FMINSEARCHBND(fun,x0,LB,UB,options,p1,p2,...)
 usage: [x,fval,exitflag,output]=FMINSEARCHBND(fun,x0,...)
 
 arguments:
  fun, x0, options - see the help for FMINSEARCH

  LB - lower bound vector or array, must be the same size as x0

       If no lower bounds exist for one of the variables, then
       supply -inf for that variable.

       If no lower bounds at all, then LB may be left empty.

       Variables may be fixed in value by setting the corresponding
       lower and upper bounds to exactly the same value.

  UB - upper bound vector or array, must be the same size as x0

       If no upper bounds exist for one of the variables, then
       supply +inf for that variable.

       If no upper bounds at all, then UB may be left empty.

       Variables may be fixed in value by setting the corresponding
       lower and upper bounds to exactly the same value.

 Notes:

  If options is supplied, then TolX will apply to the transformed
  variables. All other FMINSEARCH parameters should be unaffected.

  Variables which are constrained by both a lower and an upper
  bound will use a sin transformation. Those constrained by
  only a lower or an upper bound will use a quadratic
  transformation, and unconstrained variables will be left alone.

  Variables may be fixed by setting their respective bounds equal.
  In this case, the problem will be reduced in size for FMINSEARCH.

  The bounds are inclusive inequalities, which admit the
  boundary values themselves, but will not permit ANY function
  evaluations outside the bounds. These constraints are strictly
  followed.

  If your problem has an EXCLUSIVE (strict) constraint which will
  not admit evaluation at the bound itself, then you must provide
  a slightly offset bound. An example of this is a function which
  contains the log of one of its parameters. If you constrain the
  variable to have a lower bound of zero, then FMINSEARCHBND may
  try to evaluate the function exactly at zero.


 Example usage:
 rosen = @(x) (1-x(1)).^2 + 105*(x(2)-x(1).^2).^2;

 fminsearch(rosen,[3 3])     % unconstrained
 ans =
    1.0000    1.0000

 fminsearchbnd(rosen,[3 3],[2 2],[])     % constrained
 ans =
    2.0000    4.0000

 See test_main.m for other examples of use.


 See also: fminsearch, fminspleas


 Author: John D'Errico
 E-mail: woodchips@rochester.rr.com
 Release: 4
 Release date: 7/23/06

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Mon 26-Nov-2018 15:08:42 by m2html © 2005. iFit (c) E.Farhi/ILL EUPL 1.1