Example #3

Minimize the Material to Build a Box

The purpose of this example is to minimize the amount of cardboard required to build an open topped box with a volume of 500 cubic inches.

The image below shows the basic cardboard shape, where the dimensions “a” and “b” define both the volume of the box and the surface area of the cardboard.

Feasible Pairs

The approach used will employ a feature called “Feasible Pairs”. A feasible pair is defined by one input variable, one output variable. There is also a specified, required value for the output variable.

At each call of the control routine, the value of the input variable is found that results in the desired output value.

By using this approach, ONLY cases that are “feasible” (i.e. only boxes with 500 cubic inches) will be examined.

In this case for example, at each evaluation, the value of “a” is found that results in “Volume” being 500 in3.

This effectively changes the problem from being two dimensional in “a” and “b”, to being a one dimensional minimize problem in “b” only.

The python file is very much like Examples 1 and 2, but now with a feasible pair addition. We add a statement to define our feasible pair.

PS.makeFeasiblePair( outName="Volume", feasibleVal=500.0, inpName='a')

This “makeFeasiblePair” command simply says that our output variable is “Volume”, its feasible value is 500.0, and that the input variable “a” is used to control the value of Volume. The defined range of “a” will be used as the search range to solve for Volume = 500 in3.

For the full text of the file, click the link below.

download fold_card_feas.py

The output from the minimize operation is shown below.

Best Box

Best Box

Feasible Optimization ParametricSoln v0.1.7
by: Charlie Taylor August 01, 2016
Design Variable Summary
Design Variables (nominal values)
NameValueUnitsDescription
b 10inHeight of Box (in)
Result Variables
NameValueUnitsDescriptionLow LimitHigh Limit
a 7.07107
* ----->
inBase Dimension of Cardboard (in)
(a varies to make Volume = 500 cuin)
>1<50
Volume 500cuinBox Volume (cuin)------
boxSurfArea 332.843sqinBox Surface Area (sqin)------

PRIOR TO MINIMIZE OPTIMIZATION
ParametricSoln: Feasible Optimization

====================== OPTIMIZATION DESIGN VARIABLES =======================
      name         value        minimum   maximum
         b           10            2           10 Height of Box  (in)

 Figure of Merit: Box Surface Area (boxSurfArea) = 332.843 sqin <== Minimize
============================================================================
AFTER MINIMIZE OPTIMIZATION
ParametricSoln: Feasible Optimization

====================== OPTIMIZATION DESIGN VARIABLES =======================
      name         value        minimum   maximum
         b            5            2           10 Height of Box  (in)

 Figure of Merit: Box Surface Area (boxSurfArea) = 300 sqin <== Minimize
============================================================================
System Sensitivity
Design Variables (nominal values)
NameValueUnitsDescription
b 5inHeight of Box (in)
Result Variables
NameValueUnitsDescriptionLow LimitHigh Limit
a 10
* ----->
inBase Dimension of Cardboard (in)
(a varies to make Volume = 500 cuin)
>1<50
Volume 500cuinBox Volume (cuin)------
boxSurfArea 300sqinBox Surface Area (sqin)------
Design Variable Summary
Design Variables (nominal values)
NameValueUnitsDescription
b 5inHeight of Box (in)
Result Variables
NameValueUnitsDescriptionLow LimitHigh Limit
a 10
* ----->
inBase Dimension of Cardboard (in)
(a varies to make Volume = 500 cuin)
>1<50
Volume 500cuinBox Volume (cuin)------
boxSurfArea 300sqinBox Surface Area (sqin)------

Parametric Solutions
parasol v0.1.7
contact: C. Taylor, cet@appliedpython.com