Project

Constraint minimization problem -pen and paper calculation - using Python

problem statement:

Let us consider the given function

to minimize the function

5-(x-2)2-2(y-1)2">5−(x−2)2−2(y−1)25-(x-2)2-2(y-1)2 subjected to the condition x+4y=3">x+4y=3x+4y=3

We can use Lagrange multipliers to find the maximum or minimum value of the function.
So, we can take f(x,y) as f(x,y,λ), then we have to differentiate the function w.r.t x,y and λ equate the to zero gives the x, y and λ values which then by substituting in the function gives maximum or minimum value.
Lagrange multipliers are used in multivariable calculus to find maxima and minima of a function subject to constraints. One of the most common problems in calculus is that of finding maxima or minima (in general, "extrema") of a function, but it is often difficult to find a closed form for the function being extremized. Such difficulties often arise when one wishes to maximize or minimize a function subject to fixed outside conditions or constraints. The method of Lagrange multipliers is a powerful tool for solving this class of problems without the need to explicitly solve the conditions and use them to eliminate extra variables.

from the given equestion

f=5-(x-2)2-2(y-1)2">f=5−(x−2)2−2(y−1)2f=5-(x-2)2-2(y-1)2and

g=x+4y-3">g=x+4y−3g=x+4y-3

L=5-(x-2)2-2(y-1)2=λ(x+4y-3)1">L=5−(x−2)2−2(y−1)2=λ(x+4y−3)1L=5-(x-2)2-2(y-1)2=λ(x+4y-3)1

δlδx=0-2x+4+λ=0..............(1)">δlδx=0−2x+4+λ=0..............(1)δlδx=0-2x+4+λ=0..............(1)

δlδy=0-4y+4+4y=0.............(2)">δlδy=0−4y+4+4y=0.............(2)δlδy=0-4y+4+4y=0.............(2)

δlδλ=0x+4y-3=0...............(3)">δlδλ=0x+4y−3=0...............(3)δlδλ=0x+4y-3=0...............(3)

solving equation 1 and 2 we get y=2x-3">y=2x−3y=2x-3

substituting the value of y in eq(3) we get x+8x-12-3=0">x+8x−12−3=0x+8x-12-3=0

9x=15x=53">9x=15x=539x=15x=53

y=2(53)-3=13">y=2(53)−3=13y=2(53)-3=13

λ=2(52)-4=-23">λ=2(52)−4=−23λ=2(52)-4=-23

so the minimum value of the function wil be obtained when

x=53">x=53x=53

y=13">y=13y=13

λ=-23">λ=−23λ=-23

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.