Next: Root finding (optimize.fsolve) Up: Optimization (optimize) Previous: Least-square fitting (minimize.leastsq)

Bounded minimization (optimize.fminbound)

Thus far all of the minimization routines described have been unconstrained minimization routines. Very often, however, there are constraints that can be placed on the solution space before minimization occurs. The fminbound function is an example of a constrained minimization procedure that provides a rudimentary interval constraint for scalar functions (functions which take a scalar input and return a scalar output). The interval constraint allows the minimization to occur only between two fixed endpoints.

For example, to find the minimum of \( J_{1}\left( x\right) \) near \( x=5 \), fminbound can be called using the interval \( \left[ 4,7\right] \) as a constraint. The result is \( x_{\textrm{min}}=5.3314 \):


>>> from scipy.special import j1

>>> from scipy.optimize import fminbound
>>> xmin = fminbound(j1, 4, 7)
>>> print xmin
5.33144184241



2001-07-27