Click to download: Maple 6-8 or Maple 9

 

Lagrange Multipliers      

 

TIn many applications, optimization is subject to a constraint, where a constraint is a level curve of a function that represents a restriction or condition on the values of the indepependent variables.  We first load some packages and we define a useful procedure for substitution into matrices.

>    restart:with(linalg):with(plots):with(plottools):

# matsubs(eqs,matexpr) uses the list of equations eqs to
# substitute into the coefficients of the matrix matexpr

matsubs:=proc(eqs::list,matexpr::matrix)
local i,j,ii,jj,matexpn;
ii:=rowdim(matexpr);
jj:=coldim(matexpr);
matexpn := matrix(ii,jj);
for i from 1 to rowdim(matexpr) do
   for j from 1 to coldim(matexpr) do
      matexpn[i,j] := subs(eqs,matexpr[i,j]);
   end do
end do;
evalm(matexpn)
end proc:

>   

Optimization with Constraints

Applications

Lagrange Duality

Exercises