你可考虑free software Octave
http://www.gnu.org/software/octave/download.html
Numerical Methods Library就有OPT_LAGRANGE()
[XMIN, LAMBDAMIN, FMIN] = OPT_LAGRANGE(F, GRADF, G, JACG, X0)
computed the minimum of the function FUN subject to`G(X) = 0'
with the lagrange multiplier method.
Function GRADF defines the gradient vector of F.
Function G represents equality-constrained and
function JACG defines its jacobian matrix.
F and G accept a real vector input and return a real
vector. F, GRADF, G and JACG can also be inline object.
Parameters
F evaluated function.
GRADF F's gradient function.
G equality-constrained function : 'G(X) = 0'.
X0 initial point.
Returns
XMIN computed solution of min(FUN).
LAMBDAMIN vector of Lagrange multipliers on XMIN.
FX value of FUN(X) with X computed solution.