chapter 8. lagrange multipliersocw...chapter 8. lagrange multipliers (solution) –unconstrained...

18
Min Soo KIM Department of Mechanical and Aerospace Engineering Seoul National University Optimal Design of Energy Systems (M2794.003400) Chapter 8. Lagrange Multipliers

Upload: others

Post on 26-Apr-2021

18 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Chapter 8. Lagrange MultipliersOCW...Chapter 8. Lagrange Multipliers (Solution) –Unconstrained Optimization Have to put 100m tubes in the shell: πœ‹π· 2 4 m2 200tubes/m2 βˆ—πΏm

Min Soo KIM

Department of Mechanical and Aerospace EngineeringSeoul National University

Optimal Design of Energy Systems (M2794.003400)

Chapter 8. Lagrange Multipliers

Page 2: Chapter 8. Lagrange MultipliersOCW...Chapter 8. Lagrange Multipliers (Solution) –Unconstrained Optimization Have to put 100m tubes in the shell: πœ‹π· 2 4 m2 200tubes/m2 βˆ—πΏm

Chapter 8. Lagrange Multipliers

8.1 Calculus Methods of optimization

- Differentiable function

- Equality constraints

Using calculus Using the other methods

2/18

- Inequaility constraints

- Not continuous function

Page 3: Chapter 8. Lagrange MultipliersOCW...Chapter 8. Lagrange Multipliers (Solution) –Unconstrained Optimization Have to put 100m tubes in the shell: πœ‹π· 2 4 m2 200tubes/m2 βˆ—πΏm

Chapter 8. Lagrange Multipliers

8.2 Lagrange Multiplier equations

3/18

Function : 𝑦 = 𝑦 π‘₯1, π‘₯2, β‹― , π‘₯𝑛

Constraints : πœ™1 π‘₯1, π‘₯2, β‹― , π‘₯𝑛 = 0

πœ™2 π‘₯1, π‘₯2, β‹― , π‘₯𝑛 = 0

πœ™π‘š π‘₯1, π‘₯2, β‹― , π‘₯𝑛 = 0

βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™

How to optimize the function subject to the constraints?

Page 4: Chapter 8. Lagrange MultipliersOCW...Chapter 8. Lagrange Multipliers (Solution) –Unconstrained Optimization Have to put 100m tubes in the shell: πœ‹π· 2 4 m2 200tubes/m2 βˆ—πΏm

Chapter 8. Lagrange Multipliers

8.2 Lagrange Multiplier equations

4/18

For an optimized point function f(x,y) and g(x,y) are parallel, which meansgradient of f(x,y) is tangent to that of g(x,y)

Thus, for a certain constant Ξ», equation below is established

For multiple m constraints

𝛻𝑓 π‘₯, 𝑦 = πœ†π›»π‘” π‘₯, 𝑦

𝛻𝑓 =

π‘˜=1

π‘š

πœ†π‘šπ›»π‘”π‘š = 0

Page 5: Chapter 8. Lagrange MultipliersOCW...Chapter 8. Lagrange Multipliers (Solution) –Unconstrained Optimization Have to put 100m tubes in the shell: πœ‹π· 2 4 m2 200tubes/m2 βˆ—πΏm

Chapter 8. Lagrange Multipliers

8.3 The gradient vector

Gradient of scalar

𝛻𝑦 =πœ•π‘¦

πœ•π‘₯1 𝑖1 +

πœ•π‘¦

πœ•π‘₯2 𝑖2 +β‹―+

πœ•π‘¦

πœ•π‘₯𝑛 𝑖𝑛

𝛻 = π‘”π‘Ÿπ‘Žπ‘‘π‘–π‘’π‘›π‘‘ π‘£π‘’π‘π‘‘π‘œπ‘Ÿ 𝑖 = 𝑒𝑛𝑖𝑑 π‘£π‘’π‘π‘‘π‘œπ‘Ÿ ∢ β„Žπ‘Žπ‘£π‘’ π‘‘π‘–π‘Ÿπ‘’π‘π‘‘π‘–π‘œπ‘›, 𝑒𝑛𝑖𝑑 π‘šπ‘Žπ‘”π‘›π‘–π‘‘π‘’π‘‘π‘’

( 𝑖1, 𝑖2 , 𝑖3 π‘Žπ‘Ÿπ‘’ π‘‘β„Žπ‘’ 𝑒𝑛𝑖𝑑 π‘£π‘’π‘π‘‘π‘œπ‘Ÿ 𝑖𝑛 π‘‘β„Žπ‘’ π‘₯1, π‘₯2, π‘₯3 π‘‘π‘–π‘Ÿπ‘’π‘π‘‘π‘–π‘œπ‘›)

5/18

Page 6: Chapter 8. Lagrange MultipliersOCW...Chapter 8. Lagrange Multipliers (Solution) –Unconstrained Optimization Have to put 100m tubes in the shell: πœ‹π· 2 4 m2 200tubes/m2 βˆ—πΏm

* *

1 1,m nx x

at optimum point

unknowns

m

n

m n

m nif fixed values of x’s(no optimization)

Chapter 8. Lagrange Multipliers

8.4 Further explanation of Lagrange multiplier equations

n scalar equations

𝑖1:πœ•π‘¦

πœ•π‘₯1βˆ’ πœ†1

πœ•πœ™1

πœ•π‘₯1βˆ’ πœ†π‘š

πœ•πœ™π‘š

πœ•π‘₯1= 0

βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™βˆ™

𝑖𝑛:πœ•π‘¦

πœ•π‘₯π‘›βˆ’ πœ†1

πœ•πœ™1

πœ•π‘₯π‘›βˆ’ πœ†π‘š

πœ•πœ™π‘š

πœ•π‘₯𝑛= 0

+ m constraint equations m+n simultaneous equations

6/18

optimum point can be found

Page 7: Chapter 8. Lagrange MultipliersOCW...Chapter 8. Lagrange Multipliers (Solution) –Unconstrained Optimization Have to put 100m tubes in the shell: πœ‹π· 2 4 m2 200tubes/m2 βˆ—πΏm

8.5 Unconstrained optimization

Chapter 8. Lagrange Multipliers

𝑦 = 𝑦 π‘₯1, π‘₯2,β‹― , π‘₯𝑛

β†’ 𝛻𝑦 = 0 no ϕ′𝑠 π‘œπ‘Ÿπœ•π‘¦

πœ•π‘₯1=

πœ•π‘¦

πœ•π‘₯2= β‹― =

πœ•π‘¦

πœ•π‘₯𝑛= 0

The state point where the derivatives are zero = critical point

β‡’may be max, min, saddle point, ridge, valley

7/18

Page 8: Chapter 8. Lagrange MultipliersOCW...Chapter 8. Lagrange Multipliers (Solution) –Unconstrained Optimization Have to put 100m tubes in the shell: πœ‹π· 2 4 m2 200tubes/m2 βˆ—πΏm

From (1),

Example 8.1 :

Chapter 8. Lagrange Multipliers

Find minimum value of z for a given constraint

(Solution)

8/18

𝑧 = π‘₯2 + 𝑦2 1 = π‘₯2 + π‘₯𝑦 + 𝑦2

𝛻𝑓 π‘₯, 𝑦 = πœ†π›»π‘” π‘₯, 𝑦

2π‘₯ βˆ’ πœ† 2π‘₯ + 𝑦 = 0

𝑔 π‘₯, 𝑦 βˆ’ 1 = 0

Β·Β·Β·Β·Β·(1)

Β·Β·Β·Β·Β·(2)

2𝑦 βˆ’ πœ† 2𝑦 + π‘₯ = 0𝑦 = π‘₯ π‘œπ‘Ÿ 𝑦 = βˆ’π‘₯

Substituting (2) from the result

1 = 3π‘₯2 or 1 = π‘₯2

Thus, minimum value z is at π‘₯, 𝑦 =1

3,Β±

1

3

2

3

Page 9: Chapter 8. Lagrange MultipliersOCW...Chapter 8. Lagrange Multipliers (Solution) –Unconstrained Optimization Have to put 100m tubes in the shell: πœ‹π· 2 4 m2 200tubes/m2 βˆ—πΏm

Chapter 8. Lagrange Multipliers

Example 8.2,3 : Constrained/Unconstrained optimization

A total length of 100 m of tubes must be installed in a shell-and-tube heat

exchanger.

π‘‡π‘œπ‘‘π‘Žπ‘™ π‘π‘œπ‘ π‘‘ = 900 + 1100𝐷2.5𝐿 + 320𝐷𝐿 (𝒂)

where L is the length of the heat exchanger and D is the diameter of the shell,

both in meters. 200 tubes will fit in a cross-sectional area of 1 m2 in the shell.

Determine the D and L of the heat exchanger for minimum first cost.

9/18

Page 10: Chapter 8. Lagrange MultipliersOCW...Chapter 8. Lagrange Multipliers (Solution) –Unconstrained Optimization Have to put 100m tubes in the shell: πœ‹π· 2 4 m2 200tubes/m2 βˆ—πΏm

Chapter 8. Lagrange Multipliers

(Solution) – Unconstrained Optimization

Have to put 100m tubes in the shell

: πœ‹π·2

4m2 200 tubes/m2 βˆ— 𝐿 m = 100 m

β‡’ 50πœ‹π·2𝐿 = 100 𝒃

Substitute (b) into (a)

β‡’ π‘‡π‘œπ‘‘π‘Žπ‘™ π‘π‘œπ‘ π‘‘ = 900 +2200

πœ‹π·0.5 +

640

πœ‹π·

𝑑(π‘‡π‘œπ‘‘π‘Žπ‘™ π‘π‘œπ‘ π‘‘)

𝑑(𝐷)=1100

πœ‹π·0.5βˆ’640

πœ‹π·2

π·βˆ— = 0.7 m, πΏβˆ— = 1.3 m, π‘‡π‘œπ‘‘π‘Žπ‘™ π‘π‘œπ‘ π‘‘βˆ— = $1777.45

10/18

Page 11: Chapter 8. Lagrange MultipliersOCW...Chapter 8. Lagrange Multipliers (Solution) –Unconstrained Optimization Have to put 100m tubes in the shell: πœ‹π· 2 4 m2 200tubes/m2 βˆ—πΏm

Chapter 8. Lagrange Multipliers

(Solution) – Constrained Optimization

π‘‡π‘œπ‘‘π‘Žπ‘™ π‘π‘œπ‘ π‘‘ = 900 + 1100𝐷2.5𝐿 + 320𝐷𝐿 (𝒂)

50πœ‹π·2𝐿 = 100 𝒃

𝛻y = 2.5 1100 𝐷1.5𝐿 + 320𝐿 𝑖1 + 1100𝐷2.5 + 320𝐷 𝑖2

π›»πœ™ = 100πœ‹π·πΏ 𝑖1 + 50πœ‹π·2 𝑖2

𝑖1: 2750𝐷1.5𝐿 + 320𝐿 βˆ’ πœ†100πœ‹π·πΏ = 0 (𝒄)

𝑖2: 1100𝐷2.5 + 320𝐷 βˆ’ πœ†50πœ‹π·2 = 0 𝒅

Using (b), (c), (d), find π·βˆ—, πΏβˆ—, πœ†

Result is the same as unconstrained optimization

11/18

Page 12: Chapter 8. Lagrange MultipliersOCW...Chapter 8. Lagrange Multipliers (Solution) –Unconstrained Optimization Have to put 100m tubes in the shell: πœ‹π· 2 4 m2 200tubes/m2 βˆ—πΏm

2x

1x

3y y

2y y

1y y

1dx

2dx

Chapter 8. Lagrange Multipliers

8.7 Gradient vector

- gradient vector is normal to contour line

𝑦 = 𝑦 π‘₯1, π‘₯2

𝑑𝑦 =πœ•π‘¦

πœ•π‘₯1𝑑π‘₯1 +

πœ•π‘¦

πœ•π‘₯2𝑑π‘₯2

Along the line of 𝑦 = π‘π‘œπ‘›π‘ π‘‘.

𝑑𝑦 = 0 β†’ 𝑑π‘₯1 = βˆ’π‘‘π‘₯2πœ•π‘¦/πœ•π‘₯2πœ•π‘¦/πœ•π‘₯1

Substitution into arbitrary unit vector

𝑑π‘₯1 𝑖 + 𝑑π‘₯2 𝑗

(𝑑π‘₯1)2 + (𝑑π‘₯2)

2

12/18

Page 13: Chapter 8. Lagrange MultipliersOCW...Chapter 8. Lagrange Multipliers (Solution) –Unconstrained Optimization Have to put 100m tubes in the shell: πœ‹π· 2 4 m2 200tubes/m2 βˆ—πΏm

Tangent vector

Gradient vector

0T G

Chapter 8. Lagrange Multipliers

8.7 Gradient vector

𝑇 =𝑑π‘₯1 𝑖 + 𝑑π‘₯2 𝑗

(𝑑π‘₯1)2 + (𝑑π‘₯2)

2=

𝑖2 βˆ’πœ•π‘¦/πœ•π‘₯2πœ•π‘¦/πœ•π‘₯1

𝑖1

πœ•π‘¦/πœ•π‘₯2πœ•π‘¦/πœ•π‘₯1

2

+ 1

=βˆ’

πœ•π‘¦πœ•π‘₯2

𝑖1 +πœ•π‘¦πœ•π‘₯1

𝑖2

πœ•π‘¦πœ•π‘₯2

2

+πœ•π‘¦πœ•π‘₯1

2

𝐺 =𝛻𝑦

𝛻𝑦=

πœ•π‘¦/πœ•π‘₯1 𝑖1 + πœ•π‘¦/πœ•π‘₯2 𝑖2

πœ•π‘¦/πœ•π‘₯12 + πœ•π‘¦/πœ•π‘₯2

2

13/18

Page 14: Chapter 8. Lagrange MultipliersOCW...Chapter 8. Lagrange Multipliers (Solution) –Unconstrained Optimization Have to put 100m tubes in the shell: πœ‹π· 2 4 m2 200tubes/m2 βˆ—πΏm

saddle pointridge & valley point

ridge

valley

Chapter 8. Lagrange Multipliers

8.9 Test for maximum or minimum

decide whether the point is a maximum, minimum, saddle point, ridge, or valley

14/18

Page 15: Chapter 8. Lagrange MultipliersOCW...Chapter 8. Lagrange Multipliers (Solution) –Unconstrained Optimization Have to put 100m tubes in the shell: πœ‹π· 2 4 m2 200tubes/m2 βˆ—πΏm

minimum

maximum

a1x2x

a

1x2x

Chapter 8. Lagrange Multipliers

8.9 Test for maximum or minimum

π‘₯ = π‘Ž ∢ π‘‘β„Žπ‘’ π‘šπ‘–π‘›π‘–π‘šπ‘’π‘š 𝑖𝑠 𝑒π‘₯𝑝𝑒𝑐𝑑𝑒𝑑 π‘‘π‘œ π‘œπ‘π‘π‘’π‘Ÿ

𝑦 π‘₯ = 𝑦 π‘Ž +𝑑𝑦

𝑑π‘₯π‘₯ βˆ’ π‘Ž +

1

2

𝑑2𝑦

𝑑π‘₯2(π‘₯ βˆ’ π‘Ž)2 +β‹― Taylor series expansion near π‘₯ = π‘Ž

If 𝑑𝑦

𝑑π‘₯> 0 π‘œπ‘Ÿ

𝑑𝑦

𝑑π‘₯< 0 π‘‘β„Žπ‘’π‘Ÿπ‘’ 𝑖𝑠 π‘›π‘œ π‘šπ‘–π‘›π‘–π‘šπ‘’π‘š

→𝑑𝑦

𝑑π‘₯= 0

If𝑑2𝑦

𝑑π‘₯2> 0

If𝑑2𝑦

𝑑π‘₯2< 0

𝑦 π‘₯1 > 𝑦 π‘Ž π‘€β„Žπ‘’π‘› π‘₯1 > π‘Žπ‘¦ π‘₯2 > 𝑦 π‘Ž π‘€β„Žπ‘’π‘› π‘₯2 < π‘Ž

𝑦 π‘₯1 < 𝑦 π‘Ž π‘€β„Žπ‘’π‘› π‘₯1 > π‘Žπ‘¦ π‘₯2 < 𝑦 π‘Ž π‘€β„Žπ‘’π‘› π‘₯2 < π‘Ž

15/18

Page 16: Chapter 8. Lagrange MultipliersOCW...Chapter 8. Lagrange Multipliers (Solution) –Unconstrained Optimization Have to put 100m tubes in the shell: πœ‹π· 2 4 m2 200tubes/m2 βˆ—πΏm

min

11 12

21 22

2

11 22 12

y yD

y y

y y y

max

Chapter 8. Lagrange Multipliers

8.9 Test for maximum or minimum

π‘Ž1, π‘Ž2 : π‘‘β„Žπ‘’ π‘šπ‘–π‘›π‘–π‘šπ‘’π‘š π‘œπ‘“ 𝑦 π‘₯1, π‘₯2 𝑖𝑠 𝑒π‘₯𝑝𝑒𝑐𝑑𝑒𝑑 π‘‘π‘œ π‘œπ‘π‘π‘’π‘Ÿ

𝑦 π‘₯1, π‘₯2 = 𝑦 π‘Ž1, π‘Ž2 +πœ•π‘¦

πœ•π‘₯1π‘₯1 βˆ’ π‘Ž1 +

πœ•π‘¦

πœ•π‘₯2π‘₯2 βˆ’ π‘Ž2 +

1

2𝑦11β€²β€² (π‘₯1 βˆ’ π‘Ž1)

2 +

𝑦12β€²β€² π‘₯1 βˆ’ π‘Ž1 π‘₯2 βˆ’ π‘Ž2 +

1

2𝑦22β€²β€² (π‘₯2 βˆ’ π‘Ž2)

2 +β‹―

𝐷 > 0 π‘Žπ‘›π‘‘ 𝑦11β€²β€² > 0 (𝑦22

β€²β€² > 0)

𝐷 > 0 π‘Žπ‘›π‘‘ 𝑦11β€²β€² < 0 (𝑦22

β€²β€² < 0)

𝐷 < 0 π‘Žπ‘›π‘‘ 𝑦11β€²β€² < 0 (𝑦22

β€²β€² < 0)

16/18

Page 17: Chapter 8. Lagrange MultipliersOCW...Chapter 8. Lagrange Multipliers (Solution) –Unconstrained Optimization Have to put 100m tubes in the shell: πœ‹π· 2 4 m2 200tubes/m2 βˆ—πΏm

Chapter 8. Lagrange Multipliers

Example 8.4 : Test for maximum or minimum

Optimal values of π‘₯1 and π‘₯2, test max, min

𝑦 =π‘₯12

4+

2

π‘₯1π‘₯2+ 4π‘₯2

(Solution)

πœ•π‘¦

πœ•π‘₯1=π‘₯12βˆ’

2

π‘₯12π‘₯2

πœ•π‘¦

πœ•π‘₯2= βˆ’

2

π‘₯1π‘₯22 + 4

π‘₯1βˆ— = 2, π‘₯2

βˆ— =1

2

πœ•2𝑦

πœ•π‘₯12 =

3

2,πœ•2𝑦

πœ•π‘₯22 = 16,

πœ•2𝑦

πœ•π‘₯1πœ•π‘₯2= 2

At π‘₯1 and π‘₯2

β†’3

22

2 16> 0 π‘Žπ‘›π‘‘ 𝑦11

β€²β€² > 0 minimum

17/18

Page 18: Chapter 8. Lagrange MultipliersOCW...Chapter 8. Lagrange Multipliers (Solution) –Unconstrained Optimization Have to put 100m tubes in the shell: πœ‹π· 2 4 m2 200tubes/m2 βˆ—πΏm

In example 8.3, if the total length of the tube increases from 100m torandom value β€˜H’, what would be the increase in minimum cost ?

Extra meter of tube for the heat exchanger would cost additional $8.78

Chapter 8. Lagrange Multipliers

8.10 Sensitivity coefficients

- represents the effect on the optimal value of slightlyrelaxing the constraints

- variation of optimized objective function π‘¦βˆ—

50πœ‹π·2𝐿 = 𝐻 β†’ π·βˆ— = 0.7π‘š, πΏβˆ— = 0.013𝐻

π‘‡π‘œπ‘‘π‘Žπ‘™ π‘π‘œπ‘ π‘‘βˆ— = 900 + 1100π·βˆ—2.5πΏβˆ— + 320π·βˆ—πΏβˆ— = 900 + 8.78𝐻

𝑆𝐢 =πœ•(π‘‡π‘œπ‘‘π‘Žπ‘™ π‘π‘œπ‘ π‘‘βˆ—)

πœ•π»= 8.78 = πœ†

18/18