COMM 290 Lecture 2
COMM 290 Lecture 2
Linear Straightlines
set of instructions entered into a
computer
Program
Models or real situations
hypothetical must decide
Variables unknown that we
things
Ex of
servings Maggie
we can measure
objective something
either mat the objective function or minimize the objective
Function
function
optimize the objective index
Ex man the total taste Maggie
constraints limitations
Ex max amount of calories Maggie can have for dessert
Maggi
Linear model that uses linear statements
Programan
to
optimize objective
In class notes
Solver
Using
Total Profit Set
Objective
variable cells Click
Bychanging
and
corner cells
drag
to constraints
Subject
add click amount used Es
click
then constrain 65 add then click next
then do
okay
Fake unconstrained variables
O 0 a e
non
negative method LP
select a simple
solving
somproduct
SUM PRODUCT B 3 53 136 56
LPs in Excel
• Lego: 2 decisions
• Largest Comm 290 problems: ~10 decisions
• Excel Solver limit: 200 decisions
Lego Model
Profit/kit:
$2.00
Available:
18 bricks
$3.00
11 wheels
Setting up Solver
• Set objective
• Max or Min
• Variable cells
• Subject to the constraints…
• 2 important settings
absolute command t
Relative vs. Absolute References
A B C D
1 10 =A1 =$A$1
2 20 =A2 =$A$1
3 30 =A3 =$A$1
4
5
6
7
8
9
10
11
Solver Add-in
✓ Solver
=SUMPRODUCT ISUMPRODUCTIES GS DS
1
A B C D E F G H I J K L
Gs
Amount
2 SUVs Trailers Cars Buses Planes Trains Bikes Subs Jeeps
Used
3 Bricks 1 3 1 4 6 11 1 5 2 =?
4
× + × + × + × + × + × + × + × +×
5
6 # 2 4 5 3 1 0 8 1 6
7
8
9
10
11
Hay Farm
Hay Farm
• Your friend Cassidy operates a small hay
farm, growing two types of hay — Grass and
Alfalfa. She must decide how many acres of
each type to grow this year. Cassidy rents
various pieces of equipment from a neighbouring
farmer to attach to her tractor to work the fields,
and then sells the hay she produces to a large ranch
nearby.
• This year, the neighbour has told Cassidy she can rent the seeder for
up to 10 hours, the cutter for up to 42 hours, the rake for up to 11
To find revenue cost
hours, and the baler for up to 33 hours.
• Each acre of Grass hay brings in $660 in revenue, and each acre of
Alfalfa hay brings in $820. The following information will be helpful in
profit
I
setting up the model.
0
Cutting
0.4
Raking
0.2
Baling
7/10
Alfalfa 400
profit
M
of it
Alfalfa 0.2 0.8 0.15 1/4
Cost per
hour of $130.00 $380.00 $200.00 $240.00
rental
• Cassidy is not worried about tracking her own time. How many acres
of each type of hay should Cassidy grow in order to make the most
profit?