Project

Constraint Minimization

AIM: To minimize a function subject to a constraint.

OBJECTIVES:

Minimize the following function

5-(x-2)^2 -2(y-1)^2

subject to the following constraint

x + 4y = 3

THEORY:

In mathematical optimization, the method of Lagrange multipliers is a strategy for finding the local maxima and minima of a function subject to equality constraints (i.e., subject to the condition that one or more equations have to be satisfied exactly by the chosen values of the variables). It is named for the mathematician Joseph-Louis Lagrange. The basic idea is to convert a constrained problem into a form such that the derivative test of an unconstrained problem can still be applied. The relationship between the gradient of the function and gradients of the constraints rather naturally leads to a reformulation of the original problem, known as the Lagrangian function.

PROCEDURE:

`"Given function is" f(x,y)=5-(x-2)^2 - 2(y-1)^2`

`"We observe that the given function is the form of" (a-b)^2 = a^2 - 2ab + b^2`

`"So we can write,"`

`"f(x,y)=5-((x-2)^2 -2(y-1)^2)"`

`=5-(x^2-2*x*2^2 )-2*(y^2-2*y*1+1^2 )`

`=5-(x^2-4x+4)-2(y^2-2y+1)`

`=5-x^2+4x-4-2y^2+4y-2`

`= -x^2-2y^2+4x+4y-1`

`=0`

Now create a new function by Lagrangian method,

`g(x,y)=f(x,y)+λ(x+4y-3)` where `f(x,y)=5-(x-2)^2-2(y-1)^2`

`g(x,y)=5-(x-2)^2-2(y-1)^2+λ(x+4y-3)`_________________ (A)

Here `λ` is Lagrange Multiplier

Now, eq(A) is the new function to be minimized.

So, we take, `g(x,y)=5-(x-2)^2-2(y-1)^2+λ(x+4y-3)`

By differentiating the above equation with x, y and `λ`

`(∂g)/(∂x)=-2x+4+λ=0`__________________ (1)

`(∂g)/(∂y)=-4y+4+4λ=0`_________________ (2)

`(∂g)/(∂λ)=x+4y-3=0` ___________________ (3)

By eq(2)-4*eq(1), we get

`-4y + 4 + 4λ - 4[-2x + 4 + λ] = 0`

`-4y + 4 + 4λ - (-8x + 16 + 4λ) = 0`

`-4y + 4 + 4λ + 8x - 16 -4λ = 0`

`8x - 4y - 16 - 12 = 0`

`4(2x - y - 3) = 0`

`2x - y - 3 = 0` _________________________ (4)

By rearranging eq(4) we get,

`x = (y+3)/2` __________________________ (5)

Now substituting value of x in eq(3) we get,

`(y + 3)/2 + 4y - 3 = 0`

`y/2 + 3/2 + 4y = 3`

`y + 3 + 8y = 6`

`9y + 3 = 6`

`9y = 3`

`y = 1/3`______________________________ (6)

Now substituting value of y in our constraint equation x+4y=3 we get,

`x + 4(1/3) - 3 = 0`

`x +4/3= 3`

`3x + 4 = 9`

`x=5/3`_________________________________ (7)

Now for finding the value of `λ` we substitute the calculated values of x and y in eq(1)

`-2(5/3)+ 4 + λ = 0`

`λ = -2/3`

RESULT:

`x=5/3`

`y =1/3`

`λ = -2/3`

CONCLUSION:

Here the value of function is minimized, i.e. adding both x & y we get 2/3 which is equal to the value of λ. Hence constraint is satisfied.

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.