lagrange multipliers erasmus mobility program (24apr2012) pollack mihály engineering faculty (pmmk)...
TRANSCRIPT
Lagrange Multipliers
Erasmus Mobility Program (24Apr2012)Pollack Mihály Engineering Faculty (PMMK)
University of Pécs
João Miranda
http://tiny.cc/jlm_estg ; http://tiny.cc/jlm_ist
24-Apr-12 Lagrange Multipliers 2
Lagrange Multipliers
• Introduction: maximization of 2-variable function subject to one restriction;
• Generalization: maximization of n-variable function subject to m restrictions
• Tables & Chairs problem.
24-Apr-12 Lagrange Multipliers 3
Lagrange Multipliers
Optima of multi-variable functions when submitted to several constraints.
• Problem:
– Obtain the maxima/minima of the function,
– But the variables x and y have to satisfy the equation:
),( yxfu
0),( yxg
24-Apr-12 Lagrange Multipliers 4
• Assuming y(x) as implicit function of x, the derivative of the composite function u(x,y),
(necessary condition)
• Or,
Lagrange Multipliers
dx
du
0
0.
dx
dy
y
f
x
f
x
f
dx
dy
y
f
24-Apr-12 Lagrange Multipliers 5
• The derivation of the implicit function, y(x):
then,
Lagrange Multipliers
yg
xg
dx
dy
.y
g
x
g
x
g
dx
dy
dx
dy
y
g. 0
24-Apr-12 Lagrange Multipliers 6
• Conjugating the two zero equations:
where is known as Lagrange multiplier (1736-1813).
(http://en.wikipedia.org/wiki/Joseph_Louis_Lagrange) • Re-allocating terms,
Lagrange Multipliers
dx
dy
y
f
x
f.
x
g
x
f. 0..
dx
dy
y
g
y
f
dx
dy
y
g
x
g.. 0
24-Apr-12 Lagrange Multipliers 7
• The multiplier is selected in conformity with,
and it is also necessary that:
(http://en.wikipedia.org/wiki/Lagrange_multiplier)
Lagrange Multipliers
0.
y
g
y
f
0.
x
g
x
f
24-Apr-12 Lagrange Multipliers 8
• Thus, in optimal points, the three following equations are simultaneously verified (necessary conditions to the existence
of constrained optima):
• Notice that they represent the three partial derivatives in (x, y, ) of the function:
Verify it!
Lagrange Multipliers
yxgyxfyxL ,.,),,(
0.
x
g
x
f
0.
y
g
y
f
0),( yxg
24-Apr-12 Lagrange Multipliers 9
• Procedure:1. Build the Lagrangean function, L(x,y,) ;
2. Set to zero the related first order partial derivatives;
3. Obtain the values (x, y, ) that are satisfying the system of equations.
Lagrange Multipliers
24-Apr-12 Lagrange Multipliers 10
• Problem (general):
– Obtain the maxima/minima of the function,
– But the n variables have to simultaneously satisfy the set of m (m<n) equations:
Lagrange Multipliers
),...,,( 21 nxxxfu ),...,,( 21 nxxx
0),...,,(
(...)
0),...,,(
0),...,,(
21
2212
1211
mnm
n
n
bxxxg
bxxxg
bxxxg
24-Apr-12 Lagrange Multipliers 11
• Procedure:1. Build the Lagrangean function, ;
Lagrange Multipliers
),...,,(),...,,,,...,,( 212121 nmn xxxfxxxL
12111 ),...,,(. bxxxg n
),( λxL
22122 ),...,,(. bxxxg n
mnm bxxxg ),...,,(.
...
211
24-Apr-12 Lagrange Multipliers 12
• (...) Procedure:2. Set to zero the n first order partial derivatives in
the n variables ,
and...
Lagrange Multipliers
1x
f
mnmmnn
n
bxxxgbxxxgbxxxg
xxxfL
),...,,(.(...)),...,,(.),...,,(.
),...,,(),(
212212212111
21
λx
1
11. x
g
2
11
2
.x
g
x
f
0......
(...)
22
11
n
mm
nnn x
g
x
g
x
g
x
f
1
22.
x
g
0....1
x
gmm
0.....22
22
x
g
x
g mm
),...,,( 21 nxxx
24-Apr-12 Lagrange Multipliers 13
• (...) Procedure:3. ... Notice that the first order partial derivatives in
order to the m multipliers is driving the m constraints,
Lagrange Multipliers
),...,,( 21 m
),...,,( 211 nxxxg
0),...,,(
(...)
21 mnm bxxxg
0),...,,( 2212 bxxxg n
01 b
mnmmnn
n
bxxxgbxxxgbxxxg
xxxfL
),...,,(.(...)),...,,(.),...,,(.
),...,,(),(
212212212111
21
λx
24-Apr-12 Lagrange Multipliers 14
• (...) Procedure:3. Obtain the values set that simultaneously
satisfy the group of (n + m) equations. That is,
Lagrange Multipliers
),( λx
njx
g
x
f
x
L m
i j
ii
jj
,1,0)(
.)(),(
1
xxx λ
mibgL
iii
,1,0)(),(
xx λ
24-Apr-12 Lagrange Multipliers 15
A furniture factory builds Tables (t) at a profit of 4 Euros per Table, and Chairs (c) at a profit of 3 Euros per Chair).
Suppose that only 8 short (s) pieces and 6 large (l) pieces are available for building purposes, what combination of Tables and Chairs
do you need to build to make the most profit?
.
If the availability of the short pieces is 8008 and the availability of the large pieces is 6007,
how many Tables and Chairs do you need to build to make the most profit?
Tables & Chairs (T&C)
24-Apr-12 Lagrange Multipliers 16
Note: modeling is based in the proportionality, aditivity and divisibility between the produced quantities of t and c
and profit and utilization of l and s components.
.
Tables & Chairs (T&C)
,subject to
ProfitTotalMaximize
tables
large
produce to
used
components
tables
short
produce to
used
components
chairs
large
produce to
used
components
components
ofty Availabili
large
tables
short
produce to
used
components
components
oftyAvailabili
short
24-Apr-12 Lagrange Multipliers 17
Note: modeling is based in the proportionality, aditivity and divisibility between the produced quantities of t and c
and profit and utilization of l and s components.
Tables & Chairs (T&C)
Prftmax
0,
,
ct
tosubject
600712 ct
800822 ct
ct 34
24-Apr-12 Lagrange Multipliers 18
T&C: Lagrange Multipliers
Maximize the profit function, Luc(t,c), satisfying the conditions
concerning the availability of the l and s components..
• Problem:
– Obtain the maximum value of profit function,
– But the variables t and c shall satisfy the availability of l and s:
ctPrft 34
800822
600712
ct
ct
24-Apr-12 Lagrange Multipliers 19
• Procedure:1. Build the Lagrangean function, L(t, c, 1, 2) ;
2. Set to zero the 4 first order partial derivatives;
3. Obtain the values (t, c, 1, 2) that are satisfying the system of equations.
T&C: Lagrange Multipliers
24-Apr-12 Lagrange Multipliers 20
• Procedure:1. Build the Lagrangean function, L(t, c, 1, 2) ;
T&C: Lagrange Multipliers
ct 34
600712.1 ct
),(.),(.),(),,,( 2121 ctsctlctPrftctL
800822.2 ct
24-Apr-12 Lagrange Multipliers 21
• (...) Procedure:2. Set to zero the 4 first order partial derivatives, and
notice that those related to the multipliers (1, 2) are driving the original constraints:
and...
T&C: Lagrange Multipliers
0224 21
0
0
0
0
2
1
L
Lc
Lt
L
ct 34
600712.1 ct
),,,( 21 ctL
800822.2 ct
0213 21
0600712 ct
0800822 ct
24-Apr-12 Lagrange Multipliers 22
• (...) Procedure:3. Obtain the values (t, c, 1, 2) that are
simultaneously satisfying the 4 equations:
• Re-allocating the terms of the system of equations,
T&C: Lagrange Multipliers
422 21 321 21
600712 ct
800822 ct
0224 21
0213 21
0600712 ct
0800822 ct
24-Apr-12 Lagrange Multipliers 23
• (...) Procedure:3. Obtain the values (t, c, 1, 2) that are
simultaneously satisfying the 4 equations:
• Applying the Cramer’s Rule to the 1.st subsystem,
T&C: Lagrange Multipliers
21
22
23
24
1
321
422
21
21
2.12.2
2.32.41
2.12.2
1.43.22
12
2
24
681
12
2
24
462
21
22
31
42
2
24-Apr-12 Lagrange Multipliers 24
• (...) Procedure:3. Obtain the values (t, c, 1, 2) that are
simultaneously satisfying the 4 equations:
• Applying the Cramer’s Rule to the 2.nd subsystem,
T&C: Lagrange Multipliers
22
12
28008
16007
t
800822
600712
ct
ct
1.22.2
1).8008(2).6007(t
1.22.2
)6007.(2)8008.(2
c
20032
4006
24
800812014t
20012
4002
24
1201416016
c
22
12
80082
60072
c
24-Apr-12 Lagrange Multipliers 25
• (...) Procedure:3. Obtain the values (t, c, 1, 2) that are
simultaneously satisfying the 4 equations :
• Then,
Optimal Solution!
T&C: Lagrange Multipliers
2001
2003
1
1
2
1
c
t
Edit LINDO:max 4t + 3csubject tol1) 2t + 1c <= 6007l2) 2t + 2c <= 8008END
24-Apr-12 Lagrange Multipliers 26
Lagrange Multipliers (synthesis)
• Introduction: maximization of 2-variable function subject to one restriction;
• Generalization: maximization of n-variable function subject to m restrictions
• Tables & Chairs problem.