Member-only story
Introduction to Optimization Constraints with SciPy
Explore bounds, linear and nonlinear constraints with practical Python examples
Table of contents
- Introduction
- Implementation
2.1 Unconstrained optimization
2.2 Bounds
2.3 Linear constraints
2.4 Nonlinear constraints
2.5 Applying different constraint types together - Conclusions
1. Introduction
Optimization is the process of picking the best elements from a set of potential candidates to reach a specific goal.
We perform a lot of optimization tasks in our everyday life: finding the shortest or fastest route to reach a destination, preparing a to-do list with daily assignments ordered by priority, buying groceries.
We can describe such problems starting with the definition of an objective function f(x)
.
Let us imagine that we are organizing a journey to another city, and we are trying assess a suitable departure time. In this example, the objective function f(x)
is the duration of the trip as function of the departure time x
.
We can formulate an optimization problem as the identification of the minimum or maximum value of the objective function. In our…