Constraint Minimization of Equation using lagrange's method


The main objective is to Minimize the given equation with respect to the given constraint.


This function `f(x,y) = 5-(x-2)^2 -2(y-1)^2` is subject to the following constraint `x + 4y = 3`


Make a new function as `g(x,y) = f(x,y) + lamda (x+4y-3)`

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

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

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

 Perform partial differential equation on this g(x,y) function w.r.t. x, y & `lamda`

`(del g)/(del x) = 0`

`-2x + 4+ lamda = 0`   ---------------> Eq. 1

`(del g)/(del y) = 0`

`-4y + 4+ 4lamda =0`

`lamda - y+1 =0`

`lamda = y-1`              ---------------> Eq. 2

`(del g)/(del lamda) = 0`

`x+4y-3=0`                ---------------> Eq. 3

Put eq. 2 into eq. 1, we get


`-2x+y+3=0`              ---------------> Eq. 4

multiply eq. 3 with 2 and solve with eq. 4, we get



put value of y in eq. 2, we get `lamda`

`lamda = -2/3`

put value of y in eq. 3, we get  value of x

`x = 5/3`


We get the value of x , y and `lamda`

`x = 5/3` , `y=1/3` , `lamda = -2/3`



Projects by Jitesh Sahjwani

OBJECTIVE Using the crash beam file, Comparison of simulation results of the base setup and improved shell element properties. Questions: 1.Using the crash beam file and change the run time to 55 ms. 2. Change the number of animation steps during simulation to a min Read more

Crash Worthiness analysis of housing and arm bracket using Radioss Hypermesh OBJECTIVE The key objective is to create the 2D and 3D meshing for the given models and solve the following questions PROCEDURE & Answers 1. Material property for steel we can ch Read more

Google drive link for Hypermesh files:   OBJECTIVE The key objective is to carry out the geometry cleanup operation & ignore holes less than dia 5mm, extract mid surface and create a 2D mesh Read more

Google drive link for the \'Engine_data.out\' file:   OBJECTIVE The primary aim is to create a data visualizer tool using python and perform certain things by this code is: The scri Read more

OBJECTIVE The key objective of writing this program is to perform curve fitting with the help of a linear and cubic polynomial for the Temp. & Cp data. #1. What does popt and pcov mean? #2. What does np.array(temperature) do? #3. What does the * in *popt Read more

 OBJECTIVE The key objective is to determine the minimum cushion pressure needed to break a given thickness of the ice using an air-cushion vehicle. Solve the equation by using the Newton Raphson method and Write a Python code. Methodology that we use; Whole ide Read more

OBJECTIVE  The key objective is to write a program that solves the following ODE and simulate & create an animation of the transient behavior of a simple pendulum using python. 2nd Order Equation given `(d^2theta)/dt^2 + b/m (d theta)/dt +g/l sin theta = 0` Read more

OBJECTIVE The main aim of this program in python to simulate the forward kinematics of a 2R Robotic Arm and also make animations of the plotted graph. 2R robotic arm contains two links and two rotational joints. Workspace refers to the possible locations that th Read more

OBJECTIVE The key objective of this program is to make OTTO cycle simulator.Calculate the unknown pressure & temperature and plot the PV diagram using thermal equations and find the thermal efficiency with the help of Python scripting. Otto cycle: The air-standard Read more


The End