Vous êtes sur la page 1sur 6

IE 232 Operations Research I Lab Session # 2 1. Steelco manufactures two types of steel at three different steel mills.

. During a given month, each steel mill has 200 hours of blast furnace time available. Because of differences in the furnaces at each mill, the time and cost to produce a ton of steel differs for each mill. The time and cost for each mill are shown in the table below. Each month, Steelco must manufacture at least 500 tons of steel 1 and 600 tons of steel 2. Formulate an LP to minimize the cost of manufacturing the desired steel.
Steel 1 Cost Time(min.) $10 20 $12 24 $14 28 Steel 2 Cost Time(min.) $11 22 $9 18 $10 30

Mill1 Mill2 Mill3

Let xij = Number of tons of Steel j produced each month at Mill i. Then a correct formulation is min z = 10x11 + 12x21 + 14x31 + 11x12 + 9x22 + 10x32 s.t. 20x11 + 22x12 200(60) (Mill 1 Const.) 24x21 + 18x22 200(60) (Mill2 Const.) 28x31 + 30x32 200(60) (Mill 3 Const.) x11 + x21 + x31 500(Steel 1 Demand) x12 + x22 + x32600 (Steel 2 Demand) All variables 0

2. Gotham city hospital serves cases from four diagnostic related groups (DRGs). The profit contribution, diagnostic service use (in hours), bed-day use (in days), nursing care use (in hours), and drug use (in dollars) are given in the table below. At present the hospital has available each week 570 hours of diagnostic sevices, 1000 bed-days, 50000 nursing hours, and $50000 worth of drugs. To meet the community's minimum health care demands at least 10 DRG1, 15 DRG2, 40 DRG3, and 160 DRG4 cases must be handled each week. Use LP to determine the hospital's optimal mix of DRGs.
Profit $2,000 $1,500 $500 $300 Diagnostic Services 7 4 2 1 Bed-day 5 2 1 0 Nursing Use 30 10 5 1 Drugs 800 500 150 50

DRG1 DRG2 DRG3 DRG4

Let Xi = Number of type i DRG cases handled weekly. Then the correct formulation in LINDO follows. MAX 2000 X1 + 1500 X2 + 500 X3 + 300 X4 SUBJECT TO 2) 7 X1 + 4 X2 + 2 X3 + X4 <= 570 3) 5 X1 + 2 X2 + X3 <= 1000 4) 30 X1 + 10 X2 + 5 X3 + X4 <= 50000 5) 800 X1 + 500 X2 + 150 X3 + 50 X4 <= 50000 6) X1 >= 10 7) X2 >= 15 8) X3 >= 40 9) X4 >= 160 END

IE 232 Operations Research I Lab Session # 2

Exercise: max 6x11 + 6x21 + 5x12 + 5x22 - 6x11 6x12 - 4x21 4x22 subject to x11 + x21 <= 40 x12 + x22 <= 30 x11 + x12 <= 45 x21 + x22 <= 40 0.3x11 -0.7x21>=0 0.4x22 -0.6x12>=0 End A basic template for GAMS; SETS *indices* ; SCALAR *single valued parameter* ; PARAMETERS *array of parameters-depends on a single index* ; TABLE *matrix of parameters-depends on multiple indices* ; VARIABLES *urs-z should exist here* ; POSITIVE VARIABLES *nonnegative* ; EQUATIONS ; MODEL name /constraints-generally ALL is used/; SOLVE name MIN/MAX-IMIZING Z USING LP;

IE 232 Operations Research I Lab Session # 2 For question 1; SETS i mills /mill1,mill2,mill3/ j steels /steel1, steel2/ ; SCALAR CAP /12000/ *steel mills capacity* ; PARAMETERS DEMAND(j) /steel1 500, steel2 600/ *steel demands* ; TABLE COST(i,j) steel1 steel2 mill1 10 11 mill2 12 9 mill3 14 10 *production costs* ; TABLE TIME(i,j) steel1 steel2 mill1 20 22 mill2 24 18 mill3 28 30 *production times* ; VARIABLES Z ; POSITIVE VARIABLES X(i,j) *amount of steel j produced at mill i* ; EQUATIONS obj millcap(i) demandsteel(j) ; obj.. Z=e=sum((i,j),COST(i,j)*X(i,j)); millcap(i).. sum((j),TIME(i,j)*X(i,j))=l=CAP; demandsteel(j).. sum((i),X(i,j))=g=DEMAND(j); MODEL Steelco /ALL/; SOLVE Steelco MINIMIZING z USING LP; 3

IE 232 Operations Research I Lab Session # 2

For question 2; SETS i /1*4/; SCALARS diagnos /570/ beddays /1000/; PARAMETERS profit(i) /1 2000,2 1500,3 500,4 300/ Diagnostic(i) /1 7,2 4,3 2,4 1/ Bed(i) /1 5,2 2,3 1,4 0/ Nursing(i) /1 30,2 10,3 5,4 1/ DRUG(i) /1 10,2 15,3 40,4 160/ ; VARIABLES Z ; POSITIVE VARIABLES X(i)
*type i DRG cases handled*

; EQUATIONS objective c1 c2 c3 c4 DRG(i) ; objective.. Z=e=sum(i,profit(i)*X(i)); c1.. sum(i,Diagnostic(i)*X(i))=l=diagnos; c2.. sum(i,Bed(i)*X(i))=l=beddays; c3.. sum(i,Nursing(i)*X(i))=l=50000; c4.. 800*X("1")+500*X("2")+150*X("3") +50*X("4")=l=50000; DRG(i).. X(i)=g=DRUG(i); MODEL gotham /ALL/; SOLVE gotham MAXIMIZING z USING LP;

IE 232 Operations Research I Lab Session # 2 For question exercise; SETS i chemical/c1,c2/ j drug /d1,d2/ ; PARAMETERS DEMAND(j) /d1 40, d2 30/ PURCHASE(i) /c1 45, c2 40/ ; TABLE REVENUE(i,j) d1 d2 c1 6 5 c2 6 5 ; TABLE COST(i,j) d1 d2 c1 6 6 c2 4 4 ; VARIABLES Z ; POSITIVE VARIABLES x(i,j) ; EQUATIONS obj drugdemand(j) chemicalpurchase(i) c5 c6 ; obj.. Z=e=sum((i,j),REVENUE(i,j)*x(i,j))-sum((i,j),COST(i,j)*x(i,j)); drugdemand(j).. sum(i,x(i,j))=l=demand(j); chemicalpurchase(i).. sum(j,x(i,j))=l=purchase(i); c5.. 0.3*x("c1", "d1")-0.7*x("c2", "d1")=g=0; c6.. 0.4*x("c2", "d2")-0.6*x("c1", "d2")=g=0; MODEL eli /ALL/; SOLVE eli MAXIMIZING Z USING LP;

IE 232 Operations Research I Lab Session # 2 For question other exercise that we solved in class; sets t/1*5/; parameters p(t) /1 1000 2 1000 3 1000 4 1000 5 1000/, c(t) /1 2 3 4 5 a(t) /1 2 3 4 5 2000 2000 2000 2000 2000/, 6000 7000 8000 9500 11000/;

variable z; positive variable x(t) y(t); equations obj c1(t) c2 c3(t); obj..z=e=sum(t,p(t)*x(t))+sum(t,c(t)*y(t)); c1(t)..160*y(t)-50*x(t)=g=a(t); c2..y('1')=e=50; c3(t)$(ord(t)<5)..095*y(t)+x(t)=e=y(t+1); MODEL lab /ALL/; Solve lab MINIMIZING z USING LP;

Vous aimerez peut-être aussi