1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Optimization in Python

Connected

Exercise

Find the global optimum

You've been provided with the following profit maximization problem and are tasked with finding the global maximum.

\(\Pi= -\frac{1}{4}q^4 + 11q^3 - 160q^2 + 900q\)

\(0\) is a natural lower bound for quantity and you observed that at \(q=30\) profit is negative, so \(30\) is a good candidate for upper bound.

Find the global optimum for this problem.

basinhopping has been imported for you.

Instructions

100 XP
  • Define the dictionary kwargs of keyword arguments, with bounds \(0\) and \(30\).
  • Run basinhopping, with the objective as negative of profit and the initial guess x0 passed to the minimizer kwargs.