Constrained Optimization
Angga Akbar Fanani
Constrained optimization
Sering sekali permasalahan optimasi yang kita jumpai
dalam kehidupan sehari-hari adalah permasalahan
optimasi dengan pembatas (constrained optimization).
Metode yang bisa digunakan untuk menyelesaikan
permasalahan optimasi dengan pembatas :
Subtitusi
Lagrange multiplier
Fungsi pinalti
12/15/2016
Metode Substitusi
Optimise y f x , z subject to M g x , z
langkah 1 :Use the constraint to express z in terms of x
langkah 2 : Substitute expression for z into the objective function
Langkah3 : Find the value of x that maximises or minimises the objective function
Langkah 4: Substitute this value into constraint to find corresponding value of z
langkah 5 : Substitute values for x and z to find optimal value of y (if required)
Contoh 1
Minimize (x) =x1x2x3
Subject to h (x) =x1+x2+ x3 - 1= 0
Bagaimana menemukan solusi? Menggunakan metoda subtitusi
Dengan menggunakan pembatas h(x)=0, yaitu x1=1-x2-x3 akan kita
dapatkan persoalan optimasi tanpa pembatas dengan hanya 2
variabel :
min (x2 , x3 ) = (1- x2- x3 )x2 x3
Metoda search multivariabel yang kita pelajari sebelumnya bisa kita
gunakan untuk menemukan solusi.
12/15/2016
Contoh 2
Find the minimum value of the objective function
y 4 x 2 4 z 2 2 xz
subject to the constraint
8 zx
Contoh 3
Find the minimum value of the objective function
y 2 x 2 z 2
subject to the constraint
z 2x 1
Substitution
Method
12/15/2016
Contoh 4
U U ( x1 , x 2 ) x1 x 2 2 x1
Solve for x
s.t.
60 4 x1 2 x 2
x 2 30 2 x1
Substituti ng into U(x 1 , x 2 )
U x1 30 2 x1 2 x1 32 x1 2 x12
dU dx 1 32 4 x1 0 ;
x1* 8 ; and
x 2* 14 ;
d 2U dx 12 4 0 maximum
Calculate maximum Value for U(.) : U * 128
Kerjakan jika yang disubstitusikan adalah x1
7
Contoh 5
Minimize (x) =x1x2x3
Subject to
h (x) = x12x3 + x2 x32 + x1x2-1 = 0
Apakah metoda subtitusi bisa digunakan? Sulit, karena?
Persoalan ini bisa diselesaikan teknik Lagrange Multiplier
12/15/2016
Lagrange
Multiplier
Lagrange multiplier
Lagrange multiplier digunakan untuk menyelesaikan
masalah optimasi dengan pembatas (constrained
optimization)
di
mana
pembatasnya
berupa
persamaan yang ditandai dengan =, bukan atau
Minimasi f(x), subject to
minimasi L(x, ) = f(x)
Lagrange multiplier
12/15/2016
L f x , z M g x , z
langkah 2: Find all first order partial derivatives
langkah 3: Solve the system of equations:
L
L
L
0,
0,
0
x
z
min
f ( x) x12 x2 2
s.t.
x1 x2 4
x2 4 x1
then f ( x) x12 (4 x1 ) 2
x1 2, x2 2 and f opt 8
When the constraints equations are complicated (nonlinear), this
method is difficult Lagrange multipliers is a generalized method
of this idea for solving constrained optimization problems.
12/15/2016
[1 , 2 , 3.. ]
L f ( x) i ( gi ( x) bi )
i 1
min f(x)
s.t. g i(x) bi
i 1,2,...m
min L( x, ) f ( x) i ( g i ( x) bi )
i 1
Let x* be the optimal point to the problem 2. then, we will show that x*
is also optimal to the problem 1.
From the first necessary optimal condition, at x*,
L
| * 0 gi ( x* ) bi
i x x
12/15/2016
min
f ( x) x1 x2
s.t.
x1 x2 4
L( x1 , x2 , ) ( x12 x2 2 ) (( x1 x2 ) 4)
Langkah 2: take the partial derivatives and make them to zero
L
2 x1 0
1
x1
L
2 x2 0
x2
L
( x1 x2 ) 4 0
2
3
x1 2, x2 2, f opt 8
Contoh LM
U x1 x2 2 x1 s.t.
4 x1 2 x2 60
12/15/2016
Contoh LM
U x1 x2 2 x1
s.t.
4 x1 2 x2 60
1 4x2 1 2
Lx2 x1 2 0;
1 2x1
1 4x2 1 2 1 2x1;
60 4 x1 22 x1 2;
60 48 2 x2 ;
U 814 28;
x2 2 x1 2
x1* 8
x2* 14
U * 128;
* 4
12/15/2016
Contoh 1
Minimize f(x) = 2x1 + x2
Pembatas:
x 12 + x 2 2 - 1 = 0
Kita bisa mengubah masalah di atas menjadi :
L = 2x1+x2 (x12 + x22- 1) =0
Kondisi optimalitas untuk persoalan ini adalah
L/x1= 2 2x1 = 0, x1 =1/
L/x2= 1 2x2 = 0, x2 =1/2
Contoh 1
Masukkan nilai x1 dan x2 ke dalam pembatas
h = x12 + x22- 1=0
diperoleh
1 = 5/2;
x(1) = (2/5,1/5)
2 =
5/2;
x(2) = (-2/5,-1/5)
Cek nilai turunan kedua terhadap x (d2L/dx2) dari
persoalan ini akan didapat
0
2v
H L(x; v)
2v
0
10
12/15/2016
Latihan
Carilah solusi persoalan berikut
1. Minimalkan : F(x,y) = kx-1y-2
Pembatas:
g(x,y) = x2 + y2- a2
2. Minimalkan : F =2x1+x2+10
Pembatas
g(x)= x + 2x22=3
11
12/15/2016
12