Professional Documents
Culture Documents
1 9 12 0 .75
2 16 10 14 .90
3 8 10 15 .80
4 10 8 7 .70
Blending (Food-mix or Diet) Problem
• Define the decision variables
Month 2's total investment limited to principle and interest invested locally
in Month 1:
(2) g2 + c2 + l2 = 1.0075l1
or g2 + c2 - 1.0075l1 + l2 = 0
Portfolio Planning Problem
• Define the constraints (continued)
Demand 17 13 15 19 14 16 11
Minimize z = x1 + x2 + x3 + x4 + x5 + x6 + x7
subject to x1 + x4 + x5 + x6 + x7 17
x1 + x2 + x5 + x6 + x7 13
x1 + x2 + x3 + x6 + x7 15
x1 + x2 + x3 + x4 + x7 19
x1 + x2 + x3 + x4 + x5 14
x2 + x3 + x4 + x5 + x6 16
x3 + x4 + x5 + x6 + x7 11
xj 0 for j = 1 to 7
Product-Mix Problem
Monthly Minimum
6,000 10,000 13,000 6,000
Monthly Maximum
7,000 14,000 16,000 8,500
Total material
(yards per tie) 0.125 0.08 0.10 0.10
Material Requirements
(yards per tie)
Type of Tie
Blend 1 Blend 2
Silk Polyester
Material (50/50) (30/70)
Silk 0.125 0 0 0
Silk Tie
Profit = $6.70 – (0.125 yds)($20/yd) - $0.75
= $3.45 per tie
Objective Function (in $ of profit)
Motor
Month A B
1 (January) 800 1000
2 (February) 700 1200
3 (March) 1000 1400
4 (April) 1100 1400
Production Data
Motor
(values are per motor)
A B
Production cost $10 $6
Motor
A B
Inventory cost
$0.18 $0.13
(per motor per month)
Beginning inventory
0 0
(beginning of month 1)
Ending Inventory
450 300
(end of month 4)
15
10
7.791
Y
5
3.2087
0
-5 0 5 10 15
-5
3.2087 7.791
X
Non-linear Difficulties
• Lingo is not designed to deal with non-linear
equations
• It cannot find multiple solutions
• There is a problem with solving non-linear
problems, especially if the solution is in the
negative domain
Maximum and Minimum
• The maximum and minimum functions are the
most important functions needed for
optimization problems
• These functions are used as follows:
max = objective function;
min = objective function;
Chemical Plant Example
• Objective: Maximize 1000x1 + 1500x2
• Constraints:
4x1 + 2x2 <= 80
2x1 + 5x2 <= 60
4x1 + 4x2 <= 75
x1, x2 >= 0
Chemical Plant Example
Lingo Solution
Solution, including
value of objective
function at
optimum and
optimum point
Another Example
Slack or Surplus
• The “Slack or Surplus” column contains the
values of the slack or surplus variables in the
optimal solution.
• A zero slack or surplus value means that the
corresponding constraint is binding.
Dual Price
• The dual price of a constraint is the rate at
which the objective function value will
improve as the right-hand side or constant
term of the constraint is increased a small
amount.
• It is equivalent to the shadow price term
which we learnt earlier.
Dual price illustration
Reduced Cost
• Associated with each variable in any solution is a quantity
known as the reduced cost.
• If the units of the objective function are dollars and the units
of the variable are gallons, then the units of the reduced cost
are dollars per gallon.
• The reduced cost of a variable is the amount by which the
profit contribution of the variable must be improved (e.g., by
reducing its cost) before the variable in question would have
a positive value in an optimal solution.
• Obviously, a variable that already appears in the optimal
solution will have a zero reduced cost.
Reduced cost illustration
Reduced cost illustration
Negative Values
• Lingo cannot automatically solve for a
negative variable value
• If it is suspected that a solution will be
negative, then that variable will need to be
specifically declared as free:
@free(x);
• It is a good idea to declare all variables like
this, unless of course a negative value is
infeasible
Attempting to Obtain a Negative
Solution
• The following example will demonstrate what
happens if a negative value is required to get
an optimum solution
• Lingo will automatically solve for the optimum
solution obtained from only positive variables,
even if this is not the true optimum
Attempting to Obtain a Negative
Solution
Attempting to Obtain a Negative
Solution
This solution
is viable if the
variable
values must
be positive,
but this is not
the true
optimum
Attempting to Obtain a Negative
Solution
Clearly this is
not correct as
X1 was
constrained to
be greater
than 0!
Example of < or >
Variables now
obey desired
constraints.
Objective just
happens to be
the same in this
case.