eksplorasi generic algebraic modeling system (gams) dalam
TRANSCRIPT
Ahmad Dinu Haq, Diah Chaerani, Isah AisahDepartement of Mathematics
Faculty of Mathematics and Natural Science
University of Padjadjaran
SOUTHEAST ASIAN MATHEMATICAL SOCIETY (SEAMS) SCHOOLON SPATIO TEMPORAL, DATA MINING AND OPTIMIZATION MODELING
UNPAD TRAINING CENTER, 9-19 AUG 2016
Water Sources
River Lake Reservoir Groundwater
Water
Model (Murray et al, 2012) :
Subject to
where
Minimize (1)it it
i t
p Z
; , (2)
; , , (3)
; , (4)
; , (5)
, , 0; ,
0; , ,
i
i
ikt it it it
k
ikt ikt
t
ijtl t it
l t j
t
ijtl it it
l t j
it it it
ijtl i
S X X d i t
S u i k t
Y X i t
Y Z X i t
X X Z i t
Y i j
, (6)
0; , ,ikt
t l
S i k t
i : index of area (also j)
k : index of water sources
t : index of time periods (l also)
: maximum supply of water in area i by source k in
period t
: demand for water in area i, period t
: set of areas that can be supplied by surplus in area i
: importance weight for area i, period t
: percentage of water surplus in period t permissible
to allocate to other areas/periods
: maximum number of years that water surplus could
be saved for future years
: utilized supply of water in area i by source k in
period t
: amount of water surplus in area i, period t
:amount of water deficit in area i, period t
: amount of water transferred from area i in period t
to area j in period l
: deficit after transfers in area i, period t
: population in area i
iktu
itd
i
itp
t
iktS
itX
itX
ijtlY
itZ
max 0, ikt itit
k it
u dp
pop
itpop
Allocation plot for water supply in Tarum Barat where k=1, i=1, j=2, dan t=12
Assumption:
• It is assumed that a water provider would not exceed 95 % of its surplus water supply in
any period, so αt = 0.95 in all periods
• a limit on the storage is assumed to be five years, so λ=5
Bendung
Curug
DI
Bendung
Beet
DI
Bendung
Cikarang
DI
Bendung
Bekasi
k
k
i
k
j
k
𝑖, 𝑡 1,1 1,2 1,3 1,4 1,5 1,6 1,7 1,8 1,9 1,10 1,11 1,12
𝑢𝑖 ,𝑡 44.71 44.21 57.25 26.83 18.87 25.04 37.22 57.61 76.48 89.20 58.55 38.06
𝑑𝑖,𝑡 114 114 114 114 114 114 114 114 114 114 114 114
𝑝𝑜𝑝𝑖 ,𝑡 199593 199593 199593 199593 199593 199593 199593 199593 199593 199593 199593 199593
𝑝𝑖 ,𝑡 0.0003
47156
0.0003
49647
0.0002
84329
0.0004
36739
0.0004
7662
0.0004
45707
0.0003
84683
0.0002
82525
0.0001
87983
0.0001
24253
0.0002
77815
0.0003
80474
1,1 1,2 1,3
1,4 1,5 1,6
1,7 1,8 1,9
Minimum 0.000347156 0.000349647 0.000284329
0.000436739 0.00047662 0.000445707
0.000384683 0.000282525 0.000187983
Z Z Z
Z Z Z
Z Z Z
1,10 1,11 1,12 0.000124253 0.000277815 0.000380474Z Z Z
subject to
1,1,1 1,1 1,1 1,1
1,1,2 1,2 1,2 1,2
1,1,3 1,3 1,3 1,3
1,1,4 1,4 1,4 1,4
1,1,5 1,5 1,5 1,5
1,1,6 1,6 1,6 1,6
1,1,7 1,7 1,7 1,7
1,1,8 1,8 1,8 1,8
1,1,9 1,9 1,
S X X d
S X X d
S X X d
S X X d
S X X d
S X X d
S X X d
S X X d
S X X
9 1,9
1,1,10 1,10 1,10 1,10
1,1,11 1,11 1,11 1,11
1,1,12 1,12 1,12 1,12
d
S X X d
S X X d
S X X d
1,1,1 1,1,1
1,1,2 1,1,2
1,1,3 1,1,3
1,1,4 1,1,4
1,1,5 1,1,5
1,1,6 1,1,6
1,1,7 1,1,7
1,1,8 1,1,8
1,1,9 1,1,9
1,1,10 1,1,10
1,1,11 1,1,11
1,1,12 1,1,12
S u
S u
S u
S u
S u
S u
S u
S u
S u
S u
S u
S u
1,1,1,1 1,1,1,2 1,1,1,3 1,1,1,4 1,1,1,5 1,1,1,6
1,2,1,1 1,2,1,2 1,2,1,3 1,2,1,4 1,2,1,5 1,2,1,6 1,10.95
Y Y Y Y Y Y
Y Y Y Y Y Y X
1,1,2,2 1,1,2,3 1,1,2,4 1,1,2,5 1,1,2,6 1,1,2,7
1,2,2,2 1,2,2,3 1,2,2,4 1,2,2,5 1,2,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1,2,11,6 1,2,11,7 1,2,11,8 1,2,11,9 1,2,11,10 1,2,11,11 1,11 1,11
Y Y Y Y Y Y
Y Y Y Y Y Y Z X
1,1,12,7 1,1,12,8 1,1,12,9 1,1,12,10 1,1,12,11 1,1,12,12
1,2,12,7 1,2,12,8 1,2,12,9 1,2,12,10 1,2,12,11 1,2,12,12 1,12 1,12
Y Y Y Y Y Y
Y Y Y Y Y Y Z X
Plot of water provider: The model:
Bendung
Curug
DI
Walahar
DI
Salamdarma
DI Macan
DI Gadung
k i
j
𝑖, 𝑡 1,1 1,2 1,3 1,4 1,5 1,6 1,7 1,8
𝑢𝑖 ,𝑡 285 285 285 285 285 285 285 285
𝑑𝑖 ,𝑡 93.94 165.20 133.33 127.53 183.19 239.27 220.70 60.36
𝑝𝑜𝑝𝑖,𝑡 41609 41609 41609 41609 41609 41609 41609 41609
𝑝𝑖 ,𝑡 0.0045917
95
0.0028791
85
0.0036451
25
0.0037845
18
0.0024468
26
0.0010990
41
0.0015453
39
0.005398
832
Plot of water provider: The model:
Bendung
Curug
DI
Walahar
DI
Jengkol
DI
Barugbug
k i
j
𝑖, 𝑡 1,1 1,2 1,3 1,4 1,5 1,6 1,7 1,8
𝑢𝑖 ,𝑡 285 285 285 285 285 285 285 285
𝑑𝑖 ,𝑡 93.94 165.20 133.33 127.53 183.19 239.27 220.70 60.36
𝑝𝑜𝑝𝑖,𝑡 41609 41609 41609 41609 41609 41609 41609 41609
𝑝𝑖 ,𝑡 0.0045917
95
0.0028791
85
0.0036451
25
0.0037845
18
0.0024468
26
0.0010990
41
0.0015453
39
0.005398
832
• The General Algebraic Modeling
System (GAMS) is specifically designed
for modeling linear, nonlinear and mixed
integer optimization problems.
• Using GAMS, data are entered only
once in familiar list and table form.
• Models are described in concise
algebraic statements
The Main Function:
To build mathematics algorithm
model and solve the model by giving the
optimal solution
Inputs Outputs
Sets Echo Print
Data Reference Maps
Variable Equation Listing
Equation Status Reports
Model dan Solve Results
The Basic Components of GAMS
How to Install GAMS?
You can download GAMS on this website
www.gams.com/download/
For Example:
Max 109 90 115
subject to
100 (land)
6 4 8 500 (labor)
, , 0 (nonnegativity)
corn wheat peanut
corn wheat peanut
corn wheat peanut
corn wheat peanut
X X X
X X X
X X X
X X X
the number of the land area devoted to corn production
= the number of the land area devoted to wheat production
= the number of the land area devoted to peanut production
corn
wheat
peanut
X
X
X
The optimal solution
50, 50, 0
9950
corn wheat peanutX X X
Z
SCALARS d1 /nilai_numerik/, d2
/nilai_numerik/, d3
/nilai_numerik/, ...
u1 /nilai_numerik/, u2 /nilai_numerik/, u3
/nilai_numerik/, ...;
VARIABLES F Fungsi Objektif
Xs1, Xs2, Xs3, ...
Xd1, Xd2, Xd3, ...
Z1, Z2, Z3, ...
S1, S2, S3, ...
Y1, Y2, Y3, ...
Ya, Yb, Yc, ...;
POSITIVE VARIABLES
Xs1, Xs2, Xs3, ...
Xd1, Xd2, Xd3, ...
Z1, Z2, Z3, ...
S1, S2, S3, ...
Y1, Y2, Y3, ...;
EQUATIONS FungsiObjektif meminimumkan
defisit air
Kendala1a (kendala untuk persamaan (2.4))
Kendala2a
Kendala3a
.
.
.
Kendala1b (kendala untuk persamaan (2.5))
Kendala2b
Kendala3b
.
.
.
Kendala1c (kendala untuk persamaan (2.6))
Kendala2c
Kendala3c
.
.
.
Kendala1d (kendala untuk persamaan (2.7))
Kendala2d
Kendala3d
.
.
.
;
FungsiObjektif.. F =e= p1*Z1 + p2*Z2 + p3*Z3 + ... ;
Kendala1a.. S1-Xs1+Xd1 =e= d1;
Kendala2a.. S2-Xs2+Xd2 =e= d2;
Kendala3a.. S3-Xs3+Xd3 =e= d3;
.
.
.
Kendala1b.. S1 =l= u1;
Kendala2b.. S2 =l= u2;
Kendala3b.. S3 =l= u3;
.
.
.
Kendala1c.. Y1+Y2+Y3+... =l= alpha*Xs1;
Kendala2c.. ... =l= alpha*Xs2;
Kendala2c.. ... =l= alpha*Xs2;
.
.
.
Kendala1d.. Ya+Yb+Yc+... +Z1 =e= Xd1;
Kendala2d.. ... +Z2 =e= Xd2;
Kendala3d.. ... +Z3 =e= Xd3;
.
.
.
MODEL Alokasi_Air /all/;
SOLVE Alokasi_Air USING LP MINIMIZING F;
Optimal Solution for Each Numeric Experiment
Variable I II III
F 0 0 0
44.71 93.94 93.94
44.21 165.20 165.20
57.25 133.33 133.33
26.83 127.53 127.53
18.87 183.19 183.19
25.04 239.27 239.27
37.22 220.70 220.70
57.61 60.36 60.36
76.48 - -
Variable I II III
89.20 - -
58.55 - -
38.06 - -
25.04 239.27 239.27
37.22 220.70 220.70
57.61 60.36 60.36
76.48 - -
89.20 - -
58.55 - -
38.06 - -
1,1X
1,2X
1,3X
1,4X
1,5X
1,6X
1,7X
1,8X
1,9X
1,10X
1,11X
1,12X
1,1,6,1Y
1,1,7,2Y
1,1,8,3Y
1,1,9,4Y
1,1,10,5Y
1,1,12,7Y
1,1,11,6Y
Bazara, M.S. dan Jarvis, J.J. 1977. Linear Programming and Network Flows. Canada: John Wiley
& Sons, Inc.
Broke, A., Kendrick, D., Meeraus, A., dan Raman, R. 1998. GAMS A User’s Guide. Washington:
GAMS Development Coorporation.
Bussieck, M.R., dan Meeraus, A. 2004. General Algebraic Modeling System. Dalam Josef
Kallrath (Ed.), Modelling Languages in Mathematical Optimization (hlm. 137-157). United
States of America: Springer US.
Chaerani, D., Ruchjana, B.N., Dewanto, S.P., Abdullah, A.S., Rejito, J., Rosandi, Y., dan
Dharmawan, I.A. 2016. Determining The Robust Counterpart of Uncertain Spatial
Optimization Model for Water Supply Allocation Problem. Application of Mathematics in
Industry and Life AIP Conference Proceedings, 1716: 020002-1 - 020002-9.
Chattopadhyay, D. 1999. Application of General Algebraic Modeling System to Power System
Optimization. IEEE Transactions on Power Systems, 14 (1): 15-22.
Cressie, N.A.C. 1993. Statistics for Spatial Data. United States of America: John Wiley & Sons,
Inc.
Hiller, F.S. and Lieberman, G.J. 2001. Introduction to Operation Research (7th ed.). New York:
The McGraw Hill.
McCarl, B.A. 2002. GAMS User Guide, (Online),
http://www.gams.com/help/topic/gams.doc/userguides/mccarl/mccarlgamsuserguide.pdf,
(diakses 22 November 2015).
McKinney, D.C. dan Savitsky, A.G. 1999. Basic Optimization Models for Water and Energy
Management, (Online), http://www.ce.utexas.edu/prof/mckinney/ce385d/papers/GAMS-
Tutorial.pdf, (diakses 01 September 2015).
Murray, A.T., Gober, P., Anselin, L., Rey, S.J., Sampson, D., Padegimas, P.D., dan Liu, Y. 2012.
Spatial Optimization Models for Water Supply Allocation. Water Resour Manage, 26 (8):
2243-2257.Nazir, M. 2003. Metode Penelitian. Jakarta: Ghalia Indonesia.
Nazir, M. 2003. Metode Penelitian. Jakarta: Ghalia Indonesia.
Peraturan Direksi Perum Jasa Tirta II Nomor : 1/7 /PRT/2014 tentang Rencana Pokok
Penyediaan dan Penggunaan Air untuk Tanam Padi Rendeng Musim Tanam 2014/2015,
Tanam Padi Gadu dan Tanam Palawija Musim Tanam 2015 serta Kebutuhan Air untuk Air
Minum, Industri, dan Perkebunan Tahun 2014/2015 di Daerah Irigasi Jatiluhur. 2014. Jawa
Barat: Perum Jasa Tirta II.
Prahasta, E. 2009. Sistem Informasi Geografis: Konsep-konsep Dasar (Perspektif Geodesi &
Geomatika). Bandung: Penerbit Informatika.
Rao, S.S. 2009. Engineering Optimization Theory and Practice. New Jersey. John Wiley and
Sons, Inc.
Ruchjana, B.N. 2002. Suatu Model Generalisasi Space-Tine Autoregresi dan Penerapannya pada
Produksi Minyak Bumi. Disertasi tidak diterbitkan. Bandung: Institut Teknologi Bandung.
http://gams.com , di akses 21 Maret 2016.
http://gams.com/docs/intro.htm, diakses 21 Maret, 2016.
Gambar 1. Air. Sumber: http://3.bp.blogspot.com/-
0mnzymm9NKw/VXZk6bPpscI/AAAAAAAAATQ/2ThIlCbGLN0/s1600/kuncuran%2Bair
%2Bbersih.jpg
Gambar 2. Sungai. Sumber: http://cdn2.bigcommerce.com/n-
d57o0b/ghzhrhp/product_images/uploaded_images/upper-rogue-river.jpg
Gambar 3. Danau. Sumber: https://s-media-cache-
ak0.pinimg.com/originals/13/d7/fa/13d7fa57ee79fc8ca474262b7010a6cf.jpg
Gambar 4. Waduk. Sumber: http://www.pu.go.id/images/uploads/gallery/photo/Waduk-Jatibarang-
Semarang-Di-Operasionalkan_0.jpg
Gambar 5. Air Tanah. Sumber:
http://media.nationalgeographic.co.id/daily/640/0/201601071642923/b/foto-kualitas-air-
tanah-jakarta-sudah-kritis.jpg