Optimal Design of Energy Systems
Chapter 8 Lagrange Multipliers
Min Soo KIM
Department of Mechanical and Aerospace Engineering
Seoul National University
8.1 Calculus methods of optimization Function – differentiable
Constraints - equality
Chapter 8. Lagrange Multipliers
8.2 Lagrange Multiplier equations optimize
subject to
→ optimum occurs at x values
Chapter 8. Lagrange Multipliers
1 2
( , , , n ) y  y x x  x
1 1 1 2
1 2
( , , , ) 0
( , , , ) 0
n
m m n
x x x
x x x
 
 
 
 
1 1 m m 0
y
   
       
constants : Lagrange multipliers
1 2
1 2
ˆ ˆ ˆ
n n
y y y
y i i i
x x x
  
    
   
unit vectors Gradient vector : normal to y=const. surface
8.2 Lagrange Multiplier equations
Chapter 8. Lagrange Multipliers
* *
1 m , x1 xn
at optimum point
1
1 1
1 1 1
ˆ : y m m 0
i x x x
 
    
   
1
ˆ :n 1 m m 0
n n n
i y
x x x
 
    
   
• n scalar equations
• m constraints equations
• unknowns
m
n
m  n m  n
if fixed values of x’s (no optimization)
8.5 Unconstrained optimization
Chapter 8. Lagrange Multipliers
1 2
( , , , n ) y  y x x  x
0
 y
→
1 2
0
n
y y y
x x x
      
   
ex) minimize (optimize)
y  x22 0
y x
x
  
2 2
1 2
y  x  x
1 1
2 2
2 0
2 0
y x
x
y x
x
  
  
x1
x2
y
8.6 Constrained optimization
Chapter 8. Lagrange Multipliers
x1
x2
y
ex)
minimizeconstraint .:
→
 Lagrange multiplier
2 2
1 2
y  x  x
1 2 1
x  x 
1 2 1 1 2 2
1 2
ˆ ˆ 2 ˆ 2 ˆ
y y
y i i x i x i
x x
 
    
 
1 2 1 0
x x
   1 2 1 2
1 2
ˆ ˆ ˆ ˆ
i i i i
x x
 
     
 
1 ˆ1 2 ˆ2
( 2 ) ( 2 ) 0
y
 
x
i x
i       
1 2
2 0
2 0
x x
 
 
1 2
1 2 m in
/ 2, / 2
0 .5, 0 .5 0 .5
x x
x x y
 
 
   
→
x1
x2
+
x1
x2
y
8.6 Constrained optimization
<Example 8.3> A total length of 100 m of tubes must be installed in a shell- and-tube heat exchanger, in order to provide the necessary heat- transfer area.
Total cost of the installation in dollars includes
1. The cost of the tubes, which is constant at $ 900 2. The cost of the shell =1100D2.5L
3. The cost of the floor space occupied by the heat exchanger=320 DL
Chapter 8. Lagrange Multipliers
where L is the length of the heat exchanger and D is the diameter of the shell, both in meters.
The spacing of the tubes in such that 200 tubes will fit in a cross-sectional area of 1 m2 in the shell. Determine the diameter and length of the heat exchanger for minimum first cost.
8.6 Constrained optimization
<Solution>
minimize subject to
Chapter 8. Lagrange Multipliers
9 0 0 1 1 0 0 2 .5 3 2 0
y   D L  D L
2
2 2
2
( ) ( ) 2 0 0 ( / ) 1 0 0 ( )
4
5 0 1 0 0
D m L m tu b es m m
D L
  
 
y
 
   ˆ1
: D i
ˆ2
: L i
( 2 7 5 0D1 .5L  3 2 0 )L 
(1 0 0
D L)  02 .5 2
(1 1 0 0D  3 2 0D) 
(5 0
D )  02 7 5 0 1 .5 3 2 0 1 0 0
D
 D
 
* *
0.7 , 1.3 , 8.78
D  m L  m
* 2.5
900 (1100)(0.7) (1.3) (320)(0.7)(1.3) $1777.45
y    
8.7 Gradient vector
- gradient vector is normal to contour line
Chapter 8. Lagrange Multipliers
x2
x1
y  y3
y  y2
y  y1
d x1
d x2
1 2
( , )
y  y x x
1 2
1 2
y y
d y d x d x
x x
 
 
 
0
d y   1 2 2
1
/ /
y x
d x d x
y x
 
   
substitution into arbitrary unit vector
1 2
2 2
1 2
ˆ ˆ
( ) ( )
d x i d x j
d x d x
Along the line of y  const.
8.7 Gradient vector
Chapter 8. Lagrange Multipliers
Tangent vector
Gradient vector
2
1 2 1 2 1
2 2 2 2 2
1 2 2
1 1 2
/ ˆ ˆ ˆ ˆ
ˆ ˆ /
( ) ( ) /
/ 1
y x y y
i j i j
d x i d x j y x x x
T
d x d x y x y y
y x x x
   
   
    
  
            
2 1
2 2
1 2
ˆ ˆ
y y
i j
x x
G
y y
x x
  
 
      
     
   
 T  G  0
8.9 Test for maximum or minimum
- decide whether the point is a maximum, minimum, saddle point, ridge, or valley
Chapter 8. Lagrange Multipliers
saddle point ridge & valley point
ridge
valley
8.9 Test for maximum or minimum
• expected minimum occurs at
Chapter 8. Lagrange Multipliers
( ) y  y x
2
2 2
( ) ( ) ( ) 1 ( )
2
d y d y
y x y a x a x a
d x d x
      Taylor series expansion near x  a
when
d y
 d x should be zero
2
2 0
d y d x 
If y x( 1)  y a( ) when x1  a ( 2) ( )
y x  y a x2  a minimum
2
2 0
d y d x 
If y x( 1)  y a( ) x1  a maximum
( 2) ( )
y x  y a x2  a
a
d y 0 d x 
If y x( )  y a( ) x  a
( ) ( )
y x  y a when x  a
is still considered minimum ( )
y a
is not minimum ( )
y a
when when when
x1
x2
a x1
x2
x  a
8.9 Test for maximum or minimum
• expected minimum or maximum occurs at
Chapter 8. Lagrange Multipliers
1 2
( , )
y  y x x
1 2 1 2 1 1 2 2
1 2
2 2
1 1 1 1 1 2 1 1 2 2 2 2 2 2
( , ) ( , ) ( ) ( )
1 1
( ) ( )( ) ( )
2 2
y y
y x x y a a x a x a
x x
y x a y x a x a y x a
 
    
 
  
       
min
1 1 1 2
2 1 2 2
2
1 1 2 2 1 2
y y
D y y
y y y
 
  
  
 
0
D  y1 1  0 (y2 2  0 )
0
D  max
1 2
(a ,a )
and
and
0
D  not min or max
1 1 0 ( 2 2 0 )
y  y 
8.9 Test for maximum or minimum
<Example 8.4> optimal value x
1and x
2& maximum or minimum ?
Chapter 8. Lagrange Multipliers
2 1
2 1 2
2 4
4
y x x
  x x 
<Solution>
1
2
1 1 2
2 2
x y
x x x
  
2 1 222 4
y
x x x
   
and
1* 2*1
2, 2
x  x 
→
2 2 2
2 2
1 2 1 2
3 1 6 2
2
y y y
x x x x
     
   
1 1
3 / 2 2
0 0
2 1 6
D   y   
minimum8.10 Sensitivity coefficient
- represents the effect on the optimal value of slightly relaxing the constraints
- variation of optimized objective function
Chapter 8. Lagrange Multipliers
(
*)
8 .7 8 C o st
S C   H   
y
*In example 8.3, if the total length of the tube increases from 100m to random value ‘H’, what would be the increase in minimum cost ?
* 2 .5
9 0 0 1 1 0 0 3 2 0 9 0 0 8 .7 8
C o st   D L  D L   H
2 2
5 0
D L  1 0 0  5 0
D L  HExtra meter of tube for the heat exchanger would cost additional $8.78