Professional Documents
Culture Documents
CH 03-2 Introduction To LP
CH 03-2 Introduction To LP
3/24
HSLee@SKKU
3.5 Spreadsheet Fig. 3.16
범위 (range) 이름 이용
범위 이름 (range name) 은 범위 지정한 블록 단위의 셀을 묘사하는 내용으로 결정
Wyndor 문제의 자료 셀에 주어진 이름은 : ProfitPerBatch (C4:D4), HoursUsedPerUnitProduced (C7:D9),
HoursAvailable (G7:G9) 등등
범위 이름은 단어간에 빈 칸을 허용하지 않고 , 각 단어는 대문자로 시작
범위 이름을 입력하려면
이름을 지정할 셀 , 셀 범위 또는 인접하지 않은 선택 영역을 선택 , 수식 입력줄의 왼쪽 끝에서 이름
상자를 클릭 , 선택 영역을 참조하는 데 사용할 이름을 입력
이름에는 255 자까지 사용할 수 있음 . 이름을 만드는 추가 규칙에 대한 자세한 내용은 이름의 구문 규칙에
대한 자세한 정보 섹션을 참고 . Enter 키를 입력
4/24
HSLee@SKKU
3.5 Spreadsheet Fig. 3.16
제약식 반영 Data Cell
Data cells
E7 = C7*C12 + D7*D12 (A11*x1 + A12*x2)
Target cell
Changing Cells
Output Cells
5/24
HSLee@SKKU
3.5 Spreadsheet Fig. 3.16
6/24
HSLee@SKKU
3.5 Spreadsheet
Fig. 3.17
7/24
HSLee@SKKU
3.5 Spreadsheet Fig. 3.18
8/24
HSLee@SKKU
3.5 Spreadsheet Fig. 3.19
9/24
HSLee@SKKU
3.5 Spreadsheet Fig. 3.20
10/24
HSLee@SKKU
3.5 Spreadsheet Fig. 3.21
11/24
HSLee@SKKU
3.5 Spreadsheet Fig. 3.22
12/24
Excel for Radiation Therapy
Min 0.4 x1 + 0.5 x2
s.t. 0.3 x1 + 0.1 x2 2.7
0.5 x1 + 0.5 x2 = 6
Mary's Radiation Therapy Problem 0.6 x1 + 0.4 x2 6
x1 , x2 0
Fraction of Entry Dose Range Name Cells
13/24
HSLee@SKKU
Regional Planning of Kibbutzim: Excel
Maximize Z = 1,000(x1 + x2 + x3) + 750(x4 + x5 + x6) + 250(x7 + x8 + x9)
Sugar
Beets Cotton Sorghum Range Name Cells
Net Return (per acre) $1,000 $750 $250 AcresPlanted C10:E12
CropsPlanted C13:E13
Water Consumption (per
acre) 3 2 1 MaximumQuota C15:E15
Total NetReturn C4:E4
Acres
Planted Acres Usable Proportion Water Water TotalAcresPlanted F10:F12
Sugar Re- Alloca-
Beets Cotton Sorghum Planted Land Used quired tion TotalNetReturn I15
Kibbutz 1 133.333 100 0 233.333 <= 400 0.583 600 <= 600 UsableLand H10:H12
Kibbutz 2 100 x1 250 x4 0 x7 350 <= 600 0.583 800 <= 800 WaterAllocation M10:M12
Kibbutz 3 25 x2 150 x5 0 x8 175 <= 300 0.583 375 <= 375 WaterConsumption C6:E6
Total Crops Planted x3 x6 x9 (all con-
(acres) 258.333 500 0 strained =) WaterRequired K10:K12
<= <= <=
Total
Net
Maximum Quota (acres) 600 500 325 Return $633,333.33
14/24
HSLee@SKKU
Spreadsheet Formulation for Save-It Co.
Maximize Profit = 5.5(xA1 + xA2 + xA3 + xA4) + 4.5(xB1 + xB2 + xB3 + xB4) + 3.5(xC1 + xC2 + xC3 + xC4)
Restriction on treatment cost:
3(xA1 + xB1 + xC1) + 6(xA2 + xB2 + xC2) + 4(xA3 + xB3 + xC3) + 5(xA4 + xB4 + xC4) = 30,000
B C D E F G H I J K L M
3 Grade A Grade B Grade C Rest. on amount:
4 Unit Amalg. Cost $3.00 $2.50 $2.00 xA1 + xB1 + xC1 ≥ 1,500 Total Treatment Cost $30,000
5 Unit Selling Price $8.50 $7.00 $5.50 xA2 + xB2 + xC2 ≥ 1,000 =
6 Unit Profit $5.50 $4.50 $3.50 xA3 + xB3 + xC3 ≥ 2,000 Treatment Funds Available $30,000 Availability of Materi-
7 xA4 + xB4 + xC4 ≥ 500 als:
8 xA1 + xB1 + xC1 ≤ 3,000
9 Material Allocation Unit Total xA2 + xB2 + xC2 ≤ 2,000
10 (pounds of material used for each product grade) Treament Minimum Material xA3 + xB3 + x C3 ≤ 4,000
Amount
11 Grade A Grade B Grade C Cost to Treat Treated xA4 + xB4 +Available
xC4 ≤ 1,000
12 Material 1 412.3 2,587.7 0 $3 1,500 <= 3,000 <= 3,000
13 Material 2 859.6 517.5 0 $6 1,000 <= 1,377 <= 2,000
14 Material 3 447.4 1,552.6 0 $4 2,000 <= 2,000 <= 4,000
15 Material 4 429.8 517.5 0 $5 500 <= 947 <= 1,000
16 Total Products 2,149.1 5,175.4 0
17 Mixture
18 Mixture Specifications Percents
19 Grade A, Material 1 412.3 <= 644.7 30% of Grade A
20 Total Profit $35,110 Grade A, Material 2 859.6 >= 859.6 40% of Grade A
21 Grade A, Material 3 447.4 <= 1,074.6 50% of Grade A
22 Grade A, Material 4 429.8 = 429.8 20% of Grade A
23
24 Grade B, Material 1 2,587.7 <= 2,587.7 50% of Grade B
25 Grade B, Material 2 517.5 >= 517.5 10% of Grade B
26 Grade B, Material 4 517.5 = 517.5 10% of Grade B
27
28 Grade C, Material 1 0.0 <= 0.0 70% of Grade C
16/24
HSLee@SKKU
Distribution Network: EXCEL Spreadsheet model
F1- F2- DC- W1- W2- Actual Re-
Requirement F1-F2 DC F1-W1 DC W2 W2 W1 flow quired
F1 1 1 1 50 = 50
F2 -1 1 40 = 40
DC -1 -1 1 0 = 0
W1 -1 1 -1 -30 = -30
W2 -1 -1 1 -60 = -60
Capacity 10 80
Unit Cost ($100) 2 4 9 3 1 3 2 490
Solution 0 40 10 40 80 0 20
17/24
HSLee@SKKU
Distribution Network: EXCEL Spreadsheet model
=SUMIF(B$5:B$11,I5,D$5:D$11)-SUMIF(C$5:C$11,I5,D$5:D$11)
=SUMIF(B$5:B$11,I6,D$5:D$11)-
SUMIF(C$5:C$11,I6,D$5:D$11)
18/24
HSLee@SKKU
3.6 Large Models Modeling Languages
Citgo had 3,000 functional constraints and
15,000 decision variables
Need for a modeling language
19/24
HSLee@SKKU
LINDO & LINGO – SW2
(see 부록 4.1 in pages 154 ~ 157)
20/24
HSLee@SKKU
Using LINGO to Solve LPs
Use a plain text file as input file:
no super/subscripts
case insensitive
Title is optional.
Begin with “Max = obj function” or “Min = obj function”
21/24
HSLee@SKKU
Using LINGO to Solve LPs
Below the objective function is the system command “Sub-
ject to” followed by a series of constraints.
Each constraint consists of LHS, (in)equality sign, and
RHS.
LHS is a sum of terms like the objective function
Use “>” or “>=“ for “”
(Note) By continuity assumption, “>” is interpreted as “>=“.
Use and < or “<=“ for “”
Do not use “/” as a notation for division
(Ex) “x1/x2 > 2” “x1 - 2 x2 > 0”
RHS must be a single constant (number) term. No variable should
be in the RHS.
(Ex) “x1 > 2 x2” will cause an error message. 22/24
HSLee@SKKU
Wyndor Glass Co. Problem. LINGO model
! Wyndor Glass Co. Problem. LINGO model;
! X1 = batches of product 1 per week;
! X2 = batches of product 2 per week;
! Profit, in 1000 of dollars;
[Profit]
MAX = 3*X1 + 5*X2;
! Production time;
[Plant1] X1 <= 4;
[Plant2] 2*X2 <= 12;
[Plant3] 3*X1 + 2*X2 <= 18;
23/24
HSLee@SKKU
Homework
Problem 3.5.4
Problem 3.5.5 (a), (b), (c) & (e) (not (d))
Problem 3.6.1 (a), (b), & (d) (not (c))
24/24
HSLee@SKKU