Anda di halaman 1dari 12

12/15/2016

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

h(x)=0, diubah menjadi


h(x), dimana adalah

Untuk mencari nilai x dan yang optimal, kita turunkan


fungsi Lagrange tersebut (L(x, )) dan disamakan
dengan nol.

12/15/2016

Metode Lagrange Multiplier


Optimise y f x , z subject to M g x , z
langkah 1: Define a new function

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

langkah 4: Substitute values for x and z to find


optimal
value of y (if required)

Lagrange Multipliers (LM)


LM can be used to solve NLP in which all the constraints are
equality constraints
Consider the simple optimisation problem

min

f ( x) x12 x2 2

s.t.

x1 x2 4

we can easily substitute one variable from the constraint:

x2 4 x1

then f ( x) x12 (4 x1 ) 2

using first and second order derivatives (unconstrained problem)


we can find that the optimal point is at

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

Lagrange Multipliers (LM)


Metode Pengali Lagrange hanya bisa digunakan ketika semua
pembatas dalam bentuk persamaan
min f ( x)
1
s.t. gi ( x) bi i 1, 2,3....
Lagrange function

[1 , 2 , 3.. ]

L f ( x) i ( gi ( x) bi )
i 1

Then minimize the Lagrange function


2
min L( x, )
We can prove that the optimum point of the problem 1 is the same
as the optimum point of 2

Take the two problems

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

constraints of problem 1 are satisfied


Lets take any point x in the feasible region of problem 1.
(minimization problem)
L( x* , * ) L( x ' , )
Since x* and x are both feasible,
gi ( x* ) bi gi ( x' ) bi 0 i 1,..,m
Therefore
*
'
f ( xthat
, * )x*
is
f ( xalso
, ' )minimum to the problem 1.
Which means

12/15/2016

Gunakan metode lagrange untuk menyelesaikan masalah optimisasi berikut


ini:
2
2

min

f ( x) x1 x2

s.t.

x1 x2 4

Langkah 1: Buat Lagrange function

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

Step 3: selesaikan persamaan 1, 2 dan 3, kemudian diperoleh hasil :

x1 2, x2 2, f opt 8

Contoh LM

U x1 x2 2 x1 s.t.

4 x1 2 x2 60

Kerjakan dengan L= U + (g(x)


(g(x)--c), bandingkan hasilnya
hasilnya!!
16

12/15/2016

Contoh LM
U x1 x2 2 x1

s.t.

4 x1 2 x2 60

Form the Lagrangian function


L x1 x2 2 x1 60 4 x1 2 x2
L 60 4 x1 2 x2 0
Lx1 x2 2 4 0;

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

Kerjakan dengan L= U + (g(x)


(g(x)--c), bandingkan hasilnya
hasilnya!!
17

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

Dengan memasukkan solusi x dan v di atas kita dapatkan


5
H L(x(1); v1)
0

HL adalah indefinite, sehingga x(1) = (2/5,1/5) adalah


titik belok.
5
H L(x(2); v2)
0

adalah positive definite, sehingga x(2) = (-2/5,-1/5)


adalah titik minimum.
Jika kita bisa menemukan v dan x yang optimal untuk
fungsi L maka kita menemukan solusi untuk f(x)

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

Anda mungkin juga menyukai