Solutions to Basic Optimization Problems
Explore solutions to basic optimization problems by understanding function minimization and maximization with constraints. Learn to formulate problems mathematically and solve them using Python tools. Apply concepts to practical examples such as minimizing the surface area of a soda can by handling constraints and rewriting problems for easier solutions.
We'll cover the following...
Exercise 1
We had to solve four optimization problems already written in mathematical form. Remember that writing an optimization problem in mathematical form can be very difficult. But we’re warming up, so let's simplify things a little bit.
Problem 1
The first problem is to find the minimum of . This function is very similar to since they both are always greater than or equal to zero. Any number powered by an even exponent will be positive. But also, they’re equal to zero when . If the function can never be less than zero but we know a point when it’s equal to zero, then that point should be the minimum of the function! So the answer is .
Problem 2
The second exercise is a little trickier. Now the function is more complex: . But don’t be afraid! Let’s plot this new function.
As we can see, this function is still very similar to . The minimum of the function is again. The only difference is that the value of the function at that point is one, not zero. So the changes concerning the previous code are:
- Line 4: We change the function . Now it’s