Project

Python - Constraint Minimization

Constraint Minimization

Function

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

Contraint

`x +4y=3`

`frac{deltaf}{deltax} = -2(x-2)`

`frac{deltaf}{deltay} = -4(y-1)`

`g(x,y) = f(x,y) + lambda(x+4y-3)`

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

`frac{deltag}{deltax} = -2x+4+lambda =0` ----Eq.`

`frac{deltag}{deltay} = -4y+4+4lambda=0` ----Eq.`

`frac{deltag}{deltalambda} = x+4y-3=0` ----Eq.`

From Eq.1 and Eq.2

4*Eq.1 - Eq.2

`-8(x-2)+4lambda -[-4y+4 +4lambda]=0`

`implies y = 2x-3` ----Eq.4

Applying Eq.4 in Constraint

`x+4(2x-3)=3`

`implies 9x = 15`

`implies x = frac{5}{3}`

Applying value of x in Eq.4

`y =2*frac{5}{3}-3`

`implies y = frac{1}{3}`

Applying value of x in Eq.1

`lambda = 2x-4`

`implies lambda = 2*frac{5}{3}-4`

`implies lambda = -frac{2}{3}`

Result

The various root of the equation are found to be

`X = frac{5}{3} , Y = frac{1}{3} , lambda = -frac{2}{3}`

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.