Book Image

Mastering SciPy

By : Francisco Javier Blanco-Silva, Francisco Javier B Silva
Book Image

Mastering SciPy

By: Francisco Javier Blanco-Silva, Francisco Javier B Silva

Overview of this book

Table of Contents (16 chapters)
Mastering SciPy
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Optimization


The optimization problem is best described as the search for a local maximum or minimum value of a scalar-valued function f(x). This search can be performed for all possible input values in the domain of f (and in this case, we refer to this problem as an unconstrained optimization), or for a specific subset of it that is expressible by a finite set of identities and inequalities (and we refer to this other problem as a constrained optimization). In this section, we are going to explore both modalities in several settings.

Unconstrained optimization for univariate functions

We focus on the search for the local minima of a function f(x) in an interval [a, b] (the search for local maxima can then be regarded as the search of the local minima of the function –f(x) in the same interval). For this task, we have the routine minimize_scalar in the module scipy.optimize. It accepts as obligatory input a univariate function f(x), together with a search method.

Most search methods are based...