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

Connected

Exercise

Nonlinear constrained biscuits

That was some excellent baking!

Now can you solve the same problem again using NonlinearConstraint?

Recall the constraint for the bakeries is they need to fulfill a minimum of 140 pre-orders and each factory can make 100 biscuits daily.

minimize, Bounds, and NonlinearConstraint have been loaded for you as well as the revenue function R, cost function C, and profit function profit.

Instructions

100 XP
  • Define the constraints using the lambda function q, setting the lower and upper bounds.
  • Perform optimization by adding the optimization function, bounds, and constraints to miminize().