Project : Constraint Minimization - Pen and Paper calculation
AIM :
Minimize the following function
`5-(x-2)^2 -2(y-1)^2`
subject to the following constraint
`x + 4y = 3`
Solution :
`f(x,y) = 5 − (x − 2)^2 − 2(y − 1)^2`
`=> 5 − (x^2 + 4 − 4x) − 2(y^2 + 1 − 2y) = 0`
`=> 5 − x^2 - 4 + 4x − 2y^2 - 2 + 4y = 0`
`=> − x^2 − 2y^2 + 4x + 4y - 1 = 0`
By lagrangian method:
`g(x,y) = f(x, y) + λ(x + 4y − 3)`
`g(x,y) = 5 − (x − 2)^2 − 2(y − 1)^2 + λ(x + 4y − 3)`
By equating
`{delg(x,y)}/{delx} = 0` and
`{delg(x,y)}/{dely} = 0`
We get
`{delg(x,y)}/{delx} = - 2 (x-2) + λ = 0 .............(1)`
`{delg(x,y)}/{dely} = - 4 (y-1) + 4λ = 0 ..................(2)`
From equation 1 and 2
`x = {λ+4}/{2} ................... (3)`
`y = λ+1 ................... (4)`
Substituting equation 3 and 4 and constraint equation
`x + 4y = 3`
`=> x + 4y -3 = 0`
`=> ({λ+4}/{2}) + 4(λ+1) -3 = 0`
`=> {λ}/{2}+4/2 + 4λ+4 -3 = 0`
`=> {9λ}/{2}+ 3 = 0`
`=> λ = -2/3`
Put the `λ` value in equation 3 and 4 we get
`x = {-{2}/{3}+4}/{2} = 5/3`
`y = -2/3+1 = 1/3`
Minimum of f(x,y) = `5-(5/3-2)^2 -2(1/3-1)^2 = 36/9 = 4`