Using Lagrange Multipliers To Solve A Constrained Max-Min Problem
Using Lagrange Multipliers To Solve A Constrained Max-Min Problem
Space probe
Space probe
enters the earth's atmosphere and its surface begins to heat. After 1 hour
the temperature at the point (x,y,z) on the probe's surface is
syms x y z
g = 4*x^2+y^2+4*z^2-16
g =
Step 2 The extreme values of T on the probe's surface occur where the
gradients of T and g are parallel. We set up the equations
T = 8*x^2+4*y*z-16*z+600
T =
gradg = jacobian(g,[x,y,z])
gradT = jacobian(T,[x,y,z])
gradg =
gradT =
https://www3.nd.edu/~nancy/Math20550/Demos/lagrange/lagrange_multipliers.html 1/2
23:09 16/11/2023 Using Lagrange Multipliers to Solve a Constrained Max-Min Problem
syms lam
[lsol,xsol, ysol, zsol] = solve(gradT(1)-lam*gradg(1),gradT(2)-lam*gradg(2),gradT(3)-lam*gradg(3),g);
[xsol,ysol,zsol,lsol]
ans =
[ 0, 4, 0, 0]
[ 4/3, -4/3, -4/3, 2]
[ -4/3, -4/3, -4/3, 2]
[ 0, -2, 3^(1/2), -3^(1/2)]
[ 0, -2, -3^(1/2), 3^(1/2)]
Step 4 Plug the resulting values for (x,y,z) into T and look to see where
the maximum occurs. First we turn T into a function
Tfun = inline(vectorize(T))
double([xsol,ysol,zsol, Tfun(xsol,ysol,zsol)])
Tfun =
Inline function:
Tfun(x,y,z) = 8.*x.^2 - 16.*z + 4.*y.*z + 600
ans =
0 4.0000 0 600.0000
1.3333 -1.3333 -1.3333 642.6667
-1.3333 -1.3333 -1.3333 642.6667
0 -2.0000 1.7321 558.4308
0 -2.0000 -1.7321 641.5692
https://www3.nd.edu/~nancy/Math20550/Demos/lagrange/lagrange_multipliers.html 2/2