ieng 431_lab2

23
IENG 431_LAB2 IENG 431_LAB2 27/03/09 27/03/09 Friday Friday

Upload: tiger-wiley

Post on 31-Dec-2015

36 views

Category:

Documents


0 download

DESCRIPTION

IENG 431_LAB2. 27/03/09 Friday. Example 1- Brute Production Process (@GIN):. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: IENG 431_LAB2

IENG 431_LAB2IENG 431_LAB2

27/03/0927/03/09

FridayFriday

Page 2: IENG 431_LAB2

Example 1- Brute Production Process (@GIN): Example 1- Brute Production Process (@GIN):

Rylon Corporation manufactures Brute and Chanelle perfumes. The Rylon Corporation manufactures Brute and Chanelle perfumes. The raw material needed to manufacture each type of perfume can be raw material needed to manufacture each type of perfume can be purchased for 3$ per pound. Processing 1 lb of raw material requires purchased for 3$ per pound. Processing 1 lb of raw material requires 1 hour of laboratory time. Each pound of processed raw material 1 hour of laboratory time. Each pound of processed raw material yiels 3 oz of Regular Brute Perfume and 4 oz of Regular Chanelle yiels 3 oz of Regular Brute Perfume and 4 oz of Regular Chanelle Perfume. Regular Brute can be sold for 7$/oz and Regular Chanelle Perfume. Regular Brute can be sold for 7$/oz and Regular Chanelle for $6/oz. Rylon also has the option of further processing Regular for $6/oz. Rylon also has the option of further processing Regular Brute and Regular Chanelle to produce Luxury Brute, sold at Brute and Regular Chanelle to produce Luxury Brute, sold at 18$/oz, and Luxury Chanelle,sold at $14/oz. Each ounce of Regular 18$/oz, and Luxury Chanelle,sold at $14/oz. Each ounce of Regular Brute processed further requires an additional 3 hours of laboratory Brute processed further requires an additional 3 hours of laboratory time and 4$ processing cost and yields 1 oz of Luxury Brute. Each time and 4$ processing cost and yields 1 oz of Luxury Brute. Each ounce of Regular Chanelle processed further requires an additional 2 ounce of Regular Chanelle processed further requires an additional 2 hours of laboratory time and $4 processing cost and yields 1 oz of hours of laboratory time and $4 processing cost and yields 1 oz of Luxury Chanelle. Each year, Rylon has 6,000 hours of laboratory Luxury Chanelle. Each year, Rylon has 6,000 hours of laboratory time available and can purchase upto 4,000 lb of raw material.time available and can purchase upto 4,000 lb of raw material.

Formulate an LP that can be used to determine how Rylon Formulate an LP that can be used to determine how Rylon can maximize profits. Assume that the cost of laboratory hours is a can maximize profits. Assume that the cost of laboratory hours is a fixed cost.fixed cost.

Page 3: IENG 431_LAB2

Solution to Example 1:Solution to Example 1:

Determine how much raw material to purchase and mow much of each type of Determine how much raw material to purchase and mow much of each type of perfume to produceperfume to produce

XX11=number of ounces of Regular Brute sold annually=number of ounces of Regular Brute sold annually

XX22=number of ounces of Luxury Brute sold annuallly=number of ounces of Luxury Brute sold annuallly

XX33=number of ounces of Regular Chanelle sold annually=number of ounces of Regular Chanelle sold annually

XX44=number of ounces of Luxury Chanelle sold annually=number of ounces of Luxury Chanelle sold annually

XX55=number of pounds of raw material purchased annually=number of pounds of raw material purchased annually

Profit=revenues from perfume sales-processing costs-costs of purchasing raw Profit=revenues from perfume sales-processing costs-costs of purchasing raw materialmaterial

=7X=7X11+18X+18X22+6X+6X33+14X+14X44-(4X-(4X22+4X+4X44)-3X)-3X55

Page 4: IENG 431_LAB2

Solution to Example 1:Solution to Example 1:

Max z =7XMax z =7X11+14X+14X22+6X+6X33+10X+10X44-3X-3X55

Subject toSubject to

XX55<=4,000<=4,000

3X3X22+2X+2X44+X+X55<=6,000<=6,000

XX11+X+X22-3X-3X55=0=0

XX33+X+X44-4X-4X55=0=0

XXii>=0 (i=1,2,3,4,5)>=0 (i=1,2,3,4,5)

Page 5: IENG 431_LAB2
Page 6: IENG 431_LAB2
Page 7: IENG 431_LAB2
Page 8: IENG 431_LAB2

Example 2-Production Process (@BIN):Example 2-Production Process (@BIN):

In a factory, 5 different In a factory, 5 different types of products are types of products are produced by two produced by two machines.The following machines.The following table includes the table includes the related information for related information for the product types:the product types:

Product Product typetype

Production Production Quantity/monthQuantity/month

MC-1 MC-2MC-1 MC-2

Product AProduct A 1,500 1,0001,500 1,000

Product BProduct B 1,000 8001,000 800

Product CProduct C 3,000 3,2003,000 3,200

Product DProduct D 1,900 1,5001,900 1,500

Product EProduct E 4,500 4,5004,500 4,500

Page 9: IENG 431_LAB2

Formulate a binary LP where there is no need Formulate a binary LP where there is no need to produce all product types in a month.to produce all product types in a month.

Page 10: IENG 431_LAB2

Solution to Example 2:Solution to Example 2: We have 5 types of products: XWe have 5 types of products: X11,X,X22,X,X33,X,X44 and X and X55.(i=1,2,3,4,5).(i=1,2,3,4,5)

Our decision variables are: Our decision variables are: NNii and and BBi i (i=1…(i=1…55).).

NNii=1 ;if =1 ;if machine 1machine 1 producesproduces the i the ithth productproduct NNi=0 ;otherwisei=0 ;otherwise

BBii=1 ;if =1 ;if machine 2machine 2 producproduces the ies the ithth productproduct

BBii=0 ;=0 ;OOtherwisetherwise

Page 11: IENG 431_LAB2
Page 12: IENG 431_LAB2
Page 13: IENG 431_LAB2
Page 14: IENG 431_LAB2

Using Using SetsSets in LINGO in LINGOWhen and Why?When and Why?

Whenever you are modeling situations in real life there will be Whenever you are modeling situations in real life there will be one or more groups of related objectsone or more groups of related objects. Such as customers, . Such as customers, products, trucks, machines or workers. LINGO allows you to products, trucks, machines or workers. LINGO allows you to group these related objects together in to setsgroup these related objects together in to sets. So, . So, sets are sets are groups of related objectsgroups of related objects..

Using sets, you can write a series of similar constraints in a Using sets, you can write a series of similar constraints in a single statement.single statement.

Each Each membermember in the set may have in the set may have one or more characteristicsone or more characteristics associated with it, which are called associated with it, which are called attributes attributes (They can be (They can be known in advance or unknown that LINGO solves for).known in advance or unknown that LINGO solves for).

Page 15: IENG 431_LAB2

Types of Sets in LINGOTypes of Sets in LINGO Some simple examples:Some simple examples:

Product:Product: PricePrice Truck:Truck: Hauling capacityHauling capacity Warehouse:Warehouse: Storage CapacityStorage Capacity

Types of Sets:Types of Sets:1) Primitive Set1) Primitive Set2) Derived Set2) Derived Set

Primitive Primitive Set:Set: Compose only of objects, which can not be Compose only of objects, which can not be further reduced (e.g.: A set composed of further reduced (e.g.: A set composed of 8 trucks).8 trucks).

Derived set:Derived set: It made from one or more other sets, or it is a It made from one or more other sets, or it is a subset of other sets or it is a combination of elements from the subset of other sets or it is a combination of elements from the other sets.other sets.

Page 16: IENG 431_LAB2

How to use Sets?How to use Sets?

Sets are defied in Sets are defied in sets sectionsets section. A sets section may appear . A sets section may appear anywhereanywhere in a model. in a model.

It’s necessary to define sets before using them in a model.It’s necessary to define sets before using them in a model. The sets section begins with “SETS:” and ends with The sets section begins with “SETS:” and ends with

“ENDSETS”.“ENDSETS”. Defining Primitive Sets:Defining Primitive Sets:

Set name / member list / :attribute list ;Set name / member list / :attribute list ;

ExampleExample: machines / m1, m2, m3, m4 / :working hours;: machines / m1, m2, m3, m4 / :working hours; Note:Note: member listmember list may be either may be either explicitly or implicitlyexplicitly or implicitly..

Page 17: IENG 431_LAB2

Defining Primitive SetsDefining Primitive Sets Explicitly:Explicitly:When the list of members is explicit (cleared and separated) by When the list of members is explicit (cleared and separated) by

entering a unique name for each member.entering a unique name for each member.ExampleExample: Trucks / Truck1 Truck2/ Hauling capacity ;: Trucks / Truck1 Truck2/ Hauling capacity ; Implicitly:Implicitly:When there is no list of each member’s name. In fact it is not When there is no list of each member’s name. In fact it is not

necessary to list a name for each set member.necessary to list a name for each set member. Set Name / Member1 .. Member N / :attribute list ;Set Name / Member1 .. Member N / :attribute list ;

Where member1 is the name of the fist member in the set and Where member1 is the name of the fist member in the set and member N is the name if the last member. LINGO member N is the name if the last member. LINGO automatically generates all the intermediate member names automatically generates all the intermediate member names between member1 and member N.between member1 and member N.

Page 18: IENG 431_LAB2

Defining Primitive SetsDefining Primitive Sets

Implicit member list format:Implicit member list format:

1- 1..n1- 1..n e.g. 1..5e.g. 1..5 members: 1, 2, 3, 4, 5members: 1, 2, 3, 4, 5

2- day M .. day N2- day M .. day Ne.g. MON..FRIe.g. MON..FRI

members: MON, TUE, WED, THU, FRImembers: MON, TUE, WED, THU, FRI

3- String M.. String N3- String M.. String N e.g. Mach1 .. Mach4e.g. Mach1 .. Mach4

members: Mach1, Mach2, Mach3, Mach4members: Mach1, Mach2, Mach3, Mach4

4- Month M .. Month N4- Month M .. Month N e.g. OCT .. JANe.g. OCT .. JAN

members: OCT, NOV, DEC, JANmembers: OCT, NOV, DEC, JAN

5- MonthYearM ... MonthYearN 5- MonthYearM ... MonthYearN e.g. OCT2001 ..JAN2002e.g. OCT2001 ..JAN2002

members:Oct2001, Nov2001, Dec2001, Jan2002members:Oct2001, Nov2001, Dec2001, Jan2002

Page 19: IENG 431_LAB2

Defining Primitive SetsDefining Primitive Sets

Set members may have one or more Set members may have one or more attributesattributes. Each attribute . Each attribute displays one property of each member.displays one property of each member.

ExampleExample:: students / 1..30 / name, surname, ID ; students / 1..30 / name, surname, ID ;

ExampleExample:: Suppose that The XYZ company has 5 warehouses Suppose that The XYZ company has 5 warehouses supplying 8 vendors with their products. There is limitation for supplying 8 vendors with their products. There is limitation for capacity and demand for warehouses and vendors, respectively.capacity and demand for warehouses and vendors, respectively.

Define the appropriate sets for warehouses and vendors.Define the appropriate sets for warehouses and vendors.

SETS:SETS:

Warehouse /1..5/ :capacity;Warehouse /1..5/ :capacity;

Vendor / 1..8 / demand;Vendor / 1..8 / demand;

ENDSETSENDSETS

Page 20: IENG 431_LAB2

Defining Derived SetsDefining Derived Sets

A derived set definition had the following syntax:A derived set definition had the following syntax:

Set name (parent-set-list) / member list / :attribute list;Set name (parent-set-list) / member list / :attribute list; The parent-set-list is a list of The parent-set-list is a list of previously defined setspreviously defined sets, ,

separated by commas.separated by commas. Without specifying a member list element, LINGO constructs Without specifying a member list element, LINGO constructs

(builds) (builds) all combinationsall combinations of members from each parent set to of members from each parent set to create the members of the new derived set.create the members of the new derived set.

NoteNote: For variable having more than one indices (e.g.: X: For variable having more than one indices (e.g.: Xijij) )

they should be represented in a derived set.they should be represented in a derived set.

Page 21: IENG 431_LAB2

Defining Derived SetsDefining Derived Sets

Example1:Example1:

SETS:

Product / A B / ;

Machine / M N / ;

Week / 1..2 / ;

Allowed (Product, Machine, Week) ;

ENDSETS Member Member

(A, M, 1) (A, M, 2)

(A, N, 1) (A, N, 2)

(B, M, 1) (B, M, 2)

(B, N, 1) (B, N, 2)

Allowed set members:

Page 22: IENG 431_LAB2

Defining Derived SetsDefining Derived Sets

Example2 (Explicit member):Example2 (Explicit member):SETS:

Product / A B / ;Machine / M N / ;Week / 1..2 / ;Allowed (Product, Machine, Week) / A M 1, B N 2 / ;

ENDSETSMember Member(A, M, 1) (B, N, 2)

Allowed set members:

Page 23: IENG 431_LAB2

End of today’s lab.End of today’s lab.