Contents - Index


Constraints

Inequality constraints can be placed on output variables and objective functions which allow constrained optimizations to be performed.  Constraints are added using the following four functions:

ConstraintGreaterThanOrEqual [X, 0.25]
ConstraintGreaterThan [P1+P2+P3, 0.25]
ConstraintLessThanOrEqual [X, 0.75]
ConstraintLessThan [P1+P2+P3, 0.75]

These four functions have two parameters.  The parameters can be equations that reference both inputs and outputs.  To add an constraint, first enter the equation, and then add to the end of this equation as many constraint functions as needed.  An example is shown below:

(X-0.75)^2 + (Y-0.75)^2 + ConstraintLessThanOrEqual [X+Y, 1]

This equation adds the constraint X+Y?1 to the prior equation.   The function ConstraintLessThanOrEqual [X+Y, 1] returns the value 0 if the constraint is meet so does not alter the value of the equation when added to it.  It returns an error when the constraints is not meet causing the entire equation to evaluate to an error indicating the equation is not valid at that point.

If constraints are placed on an output and that output is referenced in an equation for another output or objective function, the constraints are automatically applied to those characteristics as well.

Equality constraints can also be solved within VarTran but must be built into the model directly.  An example is shown below.  It involves mixing three components together.  The output of interest is the viscosity of the mixture.  The variables and constraints are shown below.

Inputs: F1 = fraction of first component, min target = 0.2, max target = 0.5, std. dev. = 0.02
  F2 = fraction of second component, min target = 0.3, max target = 0.5, std. dev. = 0.01
  F3 = fraction of third component, min target = 0.2, max target = 0.6, std. dev. = 0.01

Constraint: F1 + F2 + F3 = 1

Output: V = Viscosity with equation f(F1,F2,F3)

The above problem can be solved in VarTran using 3 inputs and 2 outputs as follows:

Inputs: F1 = fraction of first component, min target = 0.2, max target =0.5, std. dev. = 0.02
  F2 = fraction of second component, min target = 0.3, max target =0.5, std. dev. = 0.01
  F3Err = variation associated with third component, target = min target = max target = 0, std. dev. = 0.01, exclude from optimization

Output: F3 = 1 - F1 - F2 + F3Err + ConstraintGreaterThanOrEqual [1-F1-F2,0.2] + ConstraintLessThanOrEqual [1-F1-F2,0.6] 
  V = Viscosity with equation f(F1,F2,F3)