Chapter 4: Partial Differentiation
Section 4.9: Constrained Optimization
|
Example 4.9.2
|
|
Find the extreme values of subject to the constraint .
|
|
|
|
Solution
|
|
|
Mathematical Solution
|
|
•
|
The black curves in Figure 4.9.2(a) are the level curves of , whereas the red line is the graph of the constraint . The constraint is tangent to a level curve as a single point, yet there are two extrema.
|
•
|
First, the existence of two extrema has to be detailed, then an explanation has to be forthcoming for why the constraint is tangent to a level curve just once.
|
•
|
With and , solve , and , for . The equations to be solved are
|
|
>
|
use plots in
module()
local p1,p2,p3;
p1:=contourplot(x*y^2,x=-2..4,y=-4..4,contours=[2,4,16/3,8,-2,-4,-6,-8],color=black);
p2:=implicitplot(3*x+4*y=12,x=-2..3,y=-4..4,color=red);
p3:=display(p1,p2,view=[-2..3,-4..4]);
print(p3);
end module:
end use:
|
|
Figure 4.9.2(a) Level curves of and
|
|
|
|
|
|
and they have the two solutions (when ), and (when ). Thus, is a local minimum, and is a local maximum.
•
|
The constraint line is tangent to the level curve at . At the local minimum, the Lagrange multiplier is zero, implying that the constraint is inoperative at that point. That point is a critical point for the unconstrained optimization problem because all along the line .
|
|
|
Maple Solution - Interactive
|
|
Initialize
|
•
|
Tools≻Load Package:
Student Multivariate Calculus
|
|
Loading Student:-MultivariateCalculus
|
•
|
Context Panel: Assign Name
|
|
|
•
|
Context Panel: Assign Name
|
|
|
•
|
Apply the LagrangeMultipliers command in the Student MultivariateCalculus package, captured in the
task template. See Table 4.9.2(a).
|
|
|
|
Tools≻Tasks≻Browse:
Calculus - Multivariate≻Optimization≻Lagrange Multiplier Method
|
Method of Lagrange Multipliers
|
Enter objective function
|
|
Enter constraints entered as functions
|
|
Enter coordinate variables, separated by commas:
|
|
|
|
|
|
|
Table 4.9.2(a) The Lagrange Multiplier Method task template
|
|
|
Implement the Lagrange multiplier method via first principles
|
•
|
Context Panel: Assign Name
|
|
|
•
|
Write and press the Enter key.
|
•
|
Context Panel: Student Multivariate Calculus≻
Differentiate≻Gradient
|
•
|
Context Panel: Conversions≻To List
|
•
|
Context Panel: Solve≻Solve
|
|
|
|
|
Optimization Assistant
The Optimization Assistant is no longer listed in Tools≻Assistants. It is now found in Tools≻Tutors≻Optimization
|
•
|
A numeric solution and some useful graphics are available via the
, launched from the Context Panel on the sequence .
|
•
|
Figures 4.9.2(b, c) respectively show the Optimization Assistant finding the minimum of zero at , and the maximum of at .
|
|
|
Figure 4.9.2(b) Constrained minimum
|
|
|
|
|
Figure 4.9.2(c) Constrained maximum
|
|
|
|
•
|
Figures 4.9.2(d, e) are generated with the Plot option in the Optimization Assistant. In Figure 4.9.2(c), the constraint line is lifted to the surface, whereas in Figure 4.9.2(e), the constraint is represented as a cutting plane (gray) intersecting the surface generated by the objective function.
|
|
|
Figure 4.9.2(d) Constraint lifted to surface
|
|
|
|
|
Figure 4.9.2(e) Constraint as cutting plane
|
|
|
|
|
|
|
|
Maple Solution - Coded
|
|
Initialize
|
•
|
Install the Student MultivariateCalculus package.
|
|
|
•
|
Define , the objective function.
|
|
|
•
|
Define , the constraint function.
|
|
|
Implement the Lagrange multiplier method
|
|
|
|
|
Implement the Lagrange multiplier method from first principles
|
|
|
•
|
Use the Gradient command to obtain .
|
•
|
Use the Equate command to equate each component of to zero.
|
•
|
Use the solve command to obtain the solutions of the equations in .
|
|
|
|
|
|
|
|
<< Previous Example Section 4.9
Next Example >>
© Maplesoft, a division of Waterloo Maple Inc., 2024. All rights reserved. This product is protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation.
For more information on Maplesoft products and services, visit www.maplesoft.com
|