Constraint Minimization
Objective: The objective of this project is to minimize a simple non-linear funtion using Lagrange Multiplier
The target equation is: `f(x,y)=5-(x-2)^2-2(y-1)^2`
& the constrain equation: `x+4y=3`
Theory: In real engineering applications there is a need to minimize or maximize certain engineering quantity in some engineering simulation performed in the Multibody Dynamics, Computation Fluid Dynamics or Finite Element Analysis regime. The objective of such studies is targetted to minimize a particular function w.r.t to some variables with certain constrains in those variabes and calculate the optimal parameters for the equation.
Procedure:
The Target equation: `f(x,y)=5-(x-2)^2-2(y-1)^2` was simplified as
`f(x,y)= -x^2-2y^2+4x+4y-1`
performing contrain minimization we take
`g(x,y)=f(x,y)+λ(x+4y-3)`
where `lambda` is the Lagrange operator
Now performing partial differentiation of g(x,y) w.r.t x, y, `lambda` we get the following equations
`(partial f)/(partial x)= -2x+4+lambda` --- Eq 1
`(partial f)/(partial y)= -4y+4lambda+4` --- Eq 2
`(partial f)/(partial lambda)=x+4y-3` ----Eq 3
Now taking Eq 1, Eq 2, Eq 3 = 0, we get
`x=lambda/2+2`---Eq 4
`y=lambda +1` ----Eq 5
putting the values of x and y in Eq 3, we obtain the following equation
`(2+lambda/2)+4(lambda+1)-3=0`,
solving the equation we get, `lambda=-2/3`
Now putting the values of `lambda` obtained in Eq 4 & 5,
we get, `x=5/3` & `y = 1/3`
Results: at `x=5/3` & `y = 1/3`the funtion f(x,y) is minimized and it also satisfies the constrain equation x+4y=3