optimization langrange multiper methods

‫اعداد‬
‫أيام جبار جهاد‬
Lagrange multiper methods :-
Necessary conditions for ageneral probem
♦ The general non –linear programming Problem can be converted to a
Problem that contains only equality constraints as follows:-
Example -2-
Solve the problem by using Lagrange multiplier
method .
Zmax = x1+x24
3 x1+2 x22 ≤ 9
solution :
first :-
Zmax = x1+x24
-Zmin = - x1- x24
Second :- 3 x1+2 x22 ≤ 9
-3 x1-2 x22 ≥ -9
L(X,W,σ) = - x1- x24 + w(-3 x1-2 x22+9 - σ2)
𝜕𝐿
𝑋1
= −1 − 3𝑊 = 0 … … … … … … … (1)
𝜕𝐿
𝜕𝑋2
= −4𝑋23 − 4𝑊𝑋2 = 0 … … … … . (2)
𝜕𝐿
𝜕𝜎
= −2𝑊𝜎 =
0 … … … … … … . . … . (3)
𝜕𝐿
𝜕𝑊
= −3 x1−2 x22+9 − σ2 … … . . . . (4)
From eq (1) →
1 − 3𝑤 = 0
From eq (3)→
𝜎=0
From eq (2)
−4
𝑥23
→ 𝑤=
1
→ −4𝑥23 − 4(− 3)𝑥2=0
4
+ 𝑥2=0
3
1
4 𝑥2 (−𝑥22 + ) = 0
3
−1
3
1
1
3
√3
𝑥2 = 0 𝑜𝑟 (−𝑥22 + ) = 0 → 𝑥2 =−
+
1
When 𝑥2 =
√3
sub in eq (4)
1
−3𝑥1 − 2( )2 + 9 − 0 = 0
√3
2
25
3
9
−3𝑥1 − + 9 = 0 → 𝑥1 =
When 𝑥2 =
𝑥1 =
−1
√3
→ 𝑠𝑢𝑏 𝑖𝑛 𝑒𝑞 (4)𝑤𝑒 𝑔𝑒𝑡
25
9
When x2 = 0 𝑠𝑢𝑏 𝑖𝑛 𝑒𝑞 (4)𝑤𝑒 𝑔𝑒𝑡
−3𝑥1 − 2(0)2 + 9 + 0 = 0
-3x1+9=0→ 𝑥1 = +3
-Z = - x1 - x24 = −
-Z = -
25
9
−
1
9
25
9
1
− ( 3)4
√
= −2.88 →
-Zmin = -2.88
→ ∴ 𝑍𝑚𝑖𝑛 = 2.88
When X2 = 0 → 𝑋1 = 3
-Zmin= -3 – 0
∴ solution Zmin = 2.88
-Zmin = -3 →
∴ 𝑍𝑚𝑖𝑛 = 3
Example -3Find the dimensions of cylindrial tin (with top and bottom made up of
sheet metal to maximize its volume such that the total surface area is
equal to Ao =24π .
Solution :assume x1: radius of the cylindrical
x2: length of the cylindrical
Maximize volume = 𝜋𝑥12 ∗ 𝑥2
Ao = 2𝜋𝑥12 + 2𝜋𝑥1 𝑥2
Subject to
Ao :- total surface area
Ao = 24π (given in eq )
∴ −𝑓(𝑥1, , 𝑥2 ) = −𝜋𝑥1 ∗ 𝑥2
L(X1 , X2 , W) = - π X12 . X2 + W (2𝜋X12+2π x1.x2-Ao )
𝜕𝑙
𝜕𝑥1
𝜕𝑙
𝜕𝑥2
𝜕𝑙
𝜕𝑤
= −2𝜋𝑥1 . 𝑥2 + 4𝜋𝑥1 𝑤 + 2𝜋𝑥2 𝑤 = 0 … … … . (1)
= −𝜋𝑥12 + 2𝜋𝑥1 𝑤 = 0 … … … . (2)
= 2𝜋𝑥12 + 2𝜋𝑥1 . 𝑥2 − 𝐴𝑜 = 0 … … … . (3)
𝑤=
From eq (1)
From eq (2) :
Equal eq
𝑤=
2𝜋𝑥1 𝑥2
2𝜋 (2𝑥1+ 𝑥2 )
𝜋𝑥12
2𝜋𝑥1
=
𝑥1
2
(4) and eq (5) we get
→𝑤=
𝑥1 𝑥2
2𝑥1 +𝑥2
……………………(5)
… … … … . . (4)
𝑥1 𝑥2
2𝑥1 +𝑥2
=
𝑥1
→ 𝑥1 =
2
𝑥
𝑥
2
2
𝑥2
2
Sub in eq (3) we get
2𝜋( 2 )2 + 2𝜋 ( 2 ) . 𝑥2 − 𝐴𝑜 = 0
∴ 𝑥2 = √
∴ 𝑥2 = √
𝐴0
𝑤ℎ𝑒𝑟𝑒 𝐴𝑜 = 24𝜋 (𝑔𝑖𝑣𝑒𝑛)
1.5𝜋
24𝜋
1.5𝜋
=4
∴ X1= 2
∴ −𝑓 (𝑥1 , 𝑥2 ) = −𝜋. (2)2 = 4
-Z = -16𝜋
Zmin= 16𝜋
Example -4Minimize f(x1,x2)= x1-x2
g(x1,x2) = 3x12-2x1x2+x22-1 ≤ 0
Solution :
n> 𝑚
𝑜. 𝑘
3x12-2x1x2+x22-1 ≤ 0
-3x12+2x1x2-x22+1
L(x1,x2,w,𝜎) =x1-x2 +w(-3x12+2x1x2-x22+1- σ2)
𝜕𝑙
𝜕𝑥1
= 1 − 6𝑥1 𝑤 + 2𝑥2 𝑤 = 0 … … … … . . . (1)
𝜕𝑙
= −1 + 2𝑥1 𝑤 − 2𝑥2 𝑤 = 0 … … … . . (2)
𝜕𝑥2
𝜕𝑙
= −3𝑥12 + 2𝑥1 𝑥2 − 𝑥22 + 1 − 𝜎 2 = 0 … … … . . (3)
𝜕𝑤
𝜕𝑙
= −2𝑤𝜎 = 0 … … … . . (4)
𝜕𝜎
From eq (1) → 𝑤 =
−1
−6𝑥1 +2𝑥2
→𝑤=
From eq (2)
… … … … (5)
1
2𝑥1 −2𝑥2
… … … . . (6)
Equal eq (1) and eq (2) we get :
−1
−6𝑥1 +2𝑥2
=
1
2𝑥1 −2𝑥2
-2x1+2x2=-6x1+2x2
4x1=2x2-2x2
x1=0
Sub x1=0 and 𝜎 =0 in eq (3) we get :
-3(0)+2(0.x2) - x22+1-0 = 0
-x22+1=0→ x22=1
When
x2=1
→ ∴ 𝑥2 =
and
x1=0
F(x1,x2)min = 0 – 1 = -1
When
+
−1
o.k
x2=-1
F(x1,x2)min =0-(-1) = +1
∴ The optimum minimize solution
F(x1,x2)min = -1
when (x1=0 , x2=1)
Example-5Find the maximum of the function f(x) = 2x1+x2+10 subject to g(x) .
g(x)=𝑥1 + 2𝑥22 = 3 Using the lagrange multiplier method .
Solution :
-f(x) = -2x1-x2-10
L(x1,x,w) = f(x)+wg(x)
= -2x1-x2-10+w( 𝑥1 + 2𝑥22 -3)
𝜕𝑙
𝜕𝑥1
𝜕𝑙
𝜕𝑥2
𝜕𝑙
𝜕𝑤
= −2 + 𝑤 = 0 … … … (1)
= −1 + 4𝑥2 𝑤 = 0 … … … (2)
= 𝑥1 + 2𝑥22 − 3 = 0 … … … (3)
From eq(1) → 𝑤 = 2 sub in eq (2) we get
𝑥2 =
𝑥1 =
1
8
sub in eq(3) we get
95
32
∴ - F(x) = -2x1-x2-10
= -2*
95
32
1
− − 10
8
- F(x) = - 16.0625
F(x)= 16.0625
Example-6Solve the following Problem by the Lagrange multiplier
Example-7Zmin = x12+x22
Subject to
g(x) = x1x2-9=0
Solve the problem by using lagrange multipliers
Solution:L(x1,x2,w) = x12+x22+w(x1x2-9)
𝜕𝐿
𝜕𝑥1
𝜕𝐿
𝜕𝑥2
𝜕𝐿
𝜕𝑊
= 2𝑥1 + 𝑥2 𝑤 = 0 → 𝑤 =
= 2𝑥2 + 𝑥1 𝑊 = 0 → 𝑤 =
𝑥2
−2𝑥2
𝑥1
… … … … . (1)
… … … … (2)
= 𝑥1 𝑥2 − 9 = 0 … … . . (3)
−2𝑥1
𝑥2
−2𝑥1
=
−2𝑥2
𝑥1
X22=X12
X2=x1 sub in eq (3) we get
X1.x1-9=0
X12=9→ 𝑥1 = −
+3
X1
+3
-3
X2
+3
-3
w
-2
-2
Zmin
18
18
Min Z
Example-8min f (x) = x1+2x2-x23
x1+x2 ≤ 1
Subject to
Solution:f (x) = x1+2x2-x23
- x1-x2 ≥ 1
∴ 𝐿(𝑥, 𝑤, 𝜎) = 𝑥1 + 2𝑥2 − 𝑥23 + 𝑤(−𝑥1 − 𝑥2 + 1 − 𝜎 2 )
𝜕𝐿
𝜕𝑥1
𝜕𝐿
𝜕𝑥2
= 1 − 𝑤 = 0 … … … … . . (1)
= 2 − 3𝑋22 − 𝑊 = 0 … . . (2)
𝜕𝐿
2
=
−𝑥
−
𝑥
+
1
−
𝜎
= 0 … … . . (3)
1
2
𝜕𝑊
𝜕𝐿
𝜕𝜎
= −2𝑊. 𝜎 = 0 … … . (4)
From eq. (1):
w=1
From eq (2) :
2-3𝑥22 -1=0
→ 𝑥2 =
−1
+
√3
From eq (4) : −2(1). 𝜎 = 0 → 𝜎 = 0
From eq (3) : if → 𝑥2 = +
−𝑥1 −
1
√3
1
√3
+ 1 − 0 = 0 → 𝑥1 = 0.423
∴ 𝑓 = 0.423 + 2 ∗
1
1
√
√
3
−
(
)
= 1.385
3
3
𝑖𝑓 𝑥2 = −
−𝑥1 +
1
√3
1
√3
+ 1 − 0 = 0 → 𝑥1 = 1.577
−1
−1
√
√
∴ 𝑓 = (1.577) + 2 ∗ ( 3) − ( 3)3 = 0.614
Example-9min Z= (x1-1)2+(x2-2)2
St.
g(x) = -x1+2x2 =2
Solution:F= (x1-1)2+(x2-2)2+w(-x1+2x2-2)
𝜕𝐹
𝜕𝑥1
𝜕𝐹
𝜕𝑥2
𝜕𝐹
𝜕𝑊
= 2(𝑋1 − 1) − 𝑊 = 0 … . . (1)
= 2(𝑋2 -1)+2𝑊 = 0 … … (2)
= −𝑋1 + 2𝑋2 − 2 = 0 … . . (3)
From eq (1) → 𝑥1 =
𝑤
2
+1
From eq (2) → 𝑥2 = 2 − 𝑤
Eq. (3) becomes :𝑤
− ( 2 + 1) + 2(2 − 𝑤) − 2 = 0 → 𝑤 = 0.4
𝑎𝑛𝑠.
∴ 𝑥1 =
0.4
2
+ 1 = 1.2
𝑥2 = 2 − 0.4 = 1.6
∴ 𝑍𝑚𝑖𝑛 = (1.2 − 1)2 + (1.6 − 2)2
Example-10Max (z)= 𝑥12 +𝑥22 +𝑥32
Subject to
g1(x)=𝑥1 +𝑥2 +3𝑥3 -2=0
g2(x)=5𝑥1 +2𝑥2 +𝑥3 -5=0
Solution:min Z=-𝑥12 -𝑥22 -𝑥32
L(x,w)=- 𝑥12 -𝑥22 -𝑥32 +w1(𝑥1 +𝑥2 +3𝑥3 -2)+w2(5𝑥1 +2𝑥2 +𝑥3 -5)
𝜕𝐿
𝜕𝑥1
𝜕𝐿
𝜕𝑥2
𝜕𝐿
𝜕𝑥3
𝜕𝐿
𝜕𝑤1
𝜕𝐿
𝜕𝑤2
= −2𝑥1 + 𝑊1 + 5𝑊2 = 0
𝑥1 =
= −2𝑥2 + 𝑊1 + 2𝑊2 = 0
𝑥2 =
= −2𝑥3 + 3𝑊1 + 𝑊2 = 0
𝑥3 =
𝑤1+5𝑤2
2
𝑤1+2𝑤2
2
3𝑤1+𝑤2
2
= 𝑋1 + 𝑋2 + 3𝑋3 − 2 = 0 … … … … … . . (4)
= 5𝑋1 + 2𝑋2 + 𝑋3 − 5
5.5𝑤1 +5w2=2
5w1+15w2=5
w1=0.087
X1=0.8043
X2=0.3478
X3=2826
Example-11-
w2= 0.3043
H.w
1-
Ans.
2Ans.
3- find the solution of problem using the lagrange multipier
method .
Minimize f(x,y)= 8x2-24x y +y2
g(x,y) = 8x2+y2 =0
ans : 4-
5-
6-
7-
Min f(x,y)= -3.24
REFERENCES:-
1- Singiresus .Raw - 2009 Engineering optimizaton :theory
and practice – forth Edition by John wiley and sons ,Inc
2- A.Raindran ,k.M. Ragsdell,G.V. Reklaitis – 2006
Engineering optimization:Method and applications-second
Edition by by John wiley and sons ,Inc :978-0-471-55814-9
3- Constraind optimization .pdf . from internt (the
method of lagrange multipiers : chapter 7 )
4- Lecture of( prof. Dr. Saleh I .Khassaf )