Skip to content
Advertisement

Two constraints setting together in optimization problem

I am working on an optimization problem, and facing difficulty setting up two constraints together in Python. Hereunder, I am simplifying my problem by calculation of area and volume. Only length can be changed, other parameters should remain the same.

Constraint 1: Maximum area should be 40000m2 Constraint 2: Minimum volume should be 50000m3

Here, I can set values in dataframe by following both constraints one-by-one, how to modify code so that both constraints (1 & 2) should meet given requirements? Many Thanks for your time and support!

JavaScript

Advertisement

Answer

I believed the code below solve the current problem you are facing. If I can help any further let me know.

JavaScript

If you want to performance it through the whole column then

JavaScript

Adding the conditions I left out the first time

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement