I've played around a bit with constrained minimization using the
donlp2 package. See, for example
<http://www-fp.mcs.anl.gov/OTC/Guide/SoftwareGuide/Blurbs/donlp2.html>
and the corresponding user documentation at
<www.netlib.no/netlib/opt/donlp2/donlp2doc.ps>
I've translated this using f2cl and created a very simple interface
for maxima. You can grab the sources from
<http://common-lisp.net/~rtoy/maxima-donlp2.tar.bz2>
To use it, untar this file in the maxima top-level directory. You
should get a share/donlp2 directory.
To use this, you first have to manually load up the new f2cl-lib.lisp
there:
:lisp (load "share/donlp2/f2cl-lib.lisp")
Then you have to tell maxima to look in share/donlp2 by adding
"share/donlp2" to file_search_maxima.
Finally, "load(donlp2)" will compile and load everything needed. Note
that it takes a very long time to compile everything. On a 1.5 GHz
machine, it takes cmucl some 30 minutes to compile o8opti.lisp.
Go have lunch or something.... :-)
When it's all done and loaded, donlp2_min is the routine that does
constrained minimization: In share/donlp2 there are a few demo files.
They all work, but some give results that aren't quite correct. But
you can look at amplqp.mac for an example that works. This particular
example has 5 variables, 2 equality constraints, and 1 inequality
constraint. All constraints are of the form h(x) = 0 or g(x) >= 0.
donlp2 has a huge number of variations and options which isn't
currently supported, but some could be. In particular some of the
option variables aren't supported. All gradients that are needed are
done by differentiation and the resulting expression can be computed
accurately enough as is.
I hope this is useful to someone,
Ray