0% found this document useful (0 votes)
53 views

Notes 4

This document describes an optimization problem of determining the optimal production quantities of two asphalt products, B2 and B2Plus, to maximize profits. The problem is formulated as a linear program with the decision variables x (tons of B2) and y (tons of B2Plus). The objective is to maximize total profits based on the profits per ton of each product. Constraints include production requirements, available additive resources, and pavement demand. The linear program is solved using Microsoft Excel Solver to find the optimal solution of 4.308 tons of B2 and 2.308 tons of B2Plus for a maximum total profit of $3,600.

Uploaded by

Ming Chan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views

Notes 4

This document describes an optimization problem of determining the optimal production quantities of two asphalt products, B2 and B2Plus, to maximize profits. The problem is formulated as a linear program with the decision variables x (tons of B2) and y (tons of B2Plus). The objective is to maximize total profits based on the profits per ton of each product. Constraints include production requirements, available additive resources, and pavement demand. The linear program is solved using Microsoft Excel Solver to find the optimal solution of 4.308 tons of B2 and 2.308 tons of B2Plus for a maximum total profit of $3,600.

Uploaded by

Ming Chan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

CIVL 2170: Infrastructure Systems

Engineering and Management

Lecture 4
Optimization Modeling
Linear Programming
Satish Ukkusuri
Outline

• Example of an optimization problem


• How to formulate the problem as a mathematical
program?
• How to solve the problem using Microsoft Solver
(Excel)?

2
Example of an optimization problem

• Your company
You are the manager of an asphalt company. Your company produces two products: B2 and
B2Plus.

• Your products
Producing a ton of B2Plus implies producing a ton of B2. When the production of B2 starts at
least 2 ton have to be produced. However, these 2 ton do not contribute to the production of
B2Plus (quality reasons). Several supplies are used to produce the asphalts. One of them is
additive x41. Although you have unlimited supply for other inputs, only 42 liters of x41 are
available in inventory. B2 requires 6 liters of x41 per ton and B2Plus requires 7 liters per ton.
The profits per ton of B2 and B2Plus are $300 and $1000 respectively. Likewise, 8 miles can be
paved with a ton of B2 and 3 miles with a ton of B2Plus.

• Demand scenario
Your company just signed a contract with the city of Imaginopolis to pave 24 miles with any
combination of B2 and B2Plus. On the other hand, you where contacted by officers of SimCity
in order to buy as much as possible of your products.

• Decision
What is the optimal combination of B2 and B2Plus that maximizes your profits?

3
How to formulate the problem as a
mathematical program?

• What do we know?
Item B2 B2Plus Constraint
Production At least 2 Made with B2 Tons of B2 has to be at least 2 + tons
tons after 2 ton B2Plus
Additive 6 liter / ton 7 liter / ton 42 liters available
Demand 8 miles / 3 miles / ton Pave at least 24 miles in
ton Imaginopolis
Profits $300 / ton $1000 / ton Maximize profits

• What are the variables?


Let x be the amount of B2 produced [tons]
Let y be the amount of B2Plus produced [tons] 4
How to formulate the problem as a
mathematical program?

• What is the objective function?


Let Z be the total profits obtained by the company [$].
We want to maximize the profits.

max Z = 300 * x + 1000 * y

hint: check units for consistency


max [$] = [$/ton] * [tons] + [$/ton] * [tons] = [$] ✔

• What are the constraints?


Production: When the production of B2 starts at least 2 ton have to be
produced. However, these 2 ton do not contribute to the production
of B2Plus (quality reasons).

x >2 +y

units: [tons] > [tons] + [tons] ✔ 5


How to formulate the problem as a
mathematical program?

• Any other constraint?


Additive: 42 liters available. x requires 6 liters per ton and y
requires 7 liters per ton

6 * x + 7 * y < 42

units: [liter/ton] * [ton] + [liter/ton] * [ton] < [liter] ✔

• Any other constraint?


Demand: Pave at least 24 miles. 8 miles can be paved with a
ton of x and 3 miles with a ton of y

8 * x + 3 * y > 24

units: [mile/ton] * [ton] + [mile/ton] * [ton] > [mile] ✔


6
How to formulate the problem as a
mathematical program?

• Any other constraint?


Non-negativity constraints: Can you produce a negative amount of B2 or
B2Plus? This has no sense. However, the mathematical program does not
“think” by itself, and you have to let it know these trivial constraints.

x>0
y>0

units: [ton] > 0 [ton] ✔

• Any other constraint?


No

7
How to formulate the problem as a
mathematical program?

• Our Linear Program

max Z = 300 * x + 1000 * y


s.t. (subject to)
x–y>2
6 * x + 7 * y < 42
8 * x + 3 * y > 24
x>0
y>0
8
How to solve the problem?

• Microsoft Solver (Excel)


Find an optimal value for a formula in one cell.
Constraints in other cells are related, either directly
or indirectly, to the formula in the target cell.
(http://office.microsoft.com/en-us/excel-help/about-solver-HP005198368.aspx)

9
Using Microsoft Solver

• Open Excel
• Make sure Microsoft Solver is installed
– Go to “Data” tab
– Go to “Analysis” box
– Check if “Solver” is there

10
Using Microsoft Solver

• If Solver is not installed


1. Click on the “File” Button
2. Click Options

11
Using Microsoft Solver

• If Solver is not installed


3. Click on Add-Ins in the left side menu
4. In “Manage:” Select “Excel Add-ins” and click “Go”

12
Using Microsoft Solver

• If Solver is not installed


5. Check “Solver Add-in” in “Add-Ins available”
6. Click Ok

13
The Excel file

• This file is in blackboard


• Variables
– Put all your variables in a Column
– It is suggested to properly label your variables

• Setting objective function and constraints


– Objective function
• Write the objective function in one cell by properly referencing
other cells as usually done in excel
– Constraints
• I one column write the left hand side of each constraint referencing
the corresponding variables
• In the next column, put the right hand side of each constraint

14
The Excel file

Description
Numbers
Notation

15
The Excel file

Description
Expression with cells

Notation
16
The Excel file

Right hand side


Constants

Description

Left hand side


Function with cells 17
Solver setup

• Click on Solver (Data\Analysis\Solver)

18
Solver setup

• Objective function
– In “Set target cell:” select the cell where you wrote the
objective function

– Select the an appropriate option: Minimize,


Maximize, Value of (equal to), according to the
purpose of your model. 19
Solver setup

• Variables
– In “By Changing Cells” select the column for the
numerical value of the variables

20
Solver setup

• For each Constraint


– Click on “Add” to add a new constraint
– Under “Cell Reference” select the left hand side of the constraint
– Select the appropriate inequality: >=, <=, =, Integer, or Binary
– Under “Constraint” select the right hand side of the constraint
– Repeat up to having the whole set of constraints

After entering all


the constraints

21
Solver Solution

22
Summary

• From both software the following optimal


solution is obtained:

Variable Notation Value


Tons of B2 x 4.308 tons
Tons of B2Plus y 2.308 tons
Total Profit Z $ 3,600

• The optimal solution is producing 4.308 tons of B2


and 2.308 tons of B2Plus, with a total profit of $ 3,600

23

You might also like