Free Python optimization framework

Thursday, February 21, 2008

goldenSection vs scipy.optimize fminbound

For some numerical experiments (intended by our chief Petro I. Stetsyuk and me) with r-algorithm (that is implemented in OO ralg solver) a good line-search optimizer is required.

As you know scipy.optimize has single-variable box-bounded optimization routine "fminbound" (connected to OO as scipy_fminbound). Unfortunately, it has 2 drawbacks:
- it uses mix of golden section and quadratic spline approximation, and latter works very bad for non-smooth and/or noisy funcs, that we deal with
- sometimes solution returned is out of lb-ub bounds.

So I have implemented pure golden section algorithm into OO solver "goldenSection" (nothing special, just several lines of code).

Monday, February 11, 2008

"noise" parameter for noisy functions

1. For NSP problems a new parameter has been implemented: noise (currently default value is 0, mb it will be changed in future). Currently ralg can handle the param for objFunc only, not for non-lin constraints c and h.
Also, the parameter can be used with nssolve and nsmm.

examples/nssolveVSfsolve_1.py has been updated (add noise=1e-8 to prob definition).

2. Some more changes to ralg.

Thursday, February 7, 2008

some changes to NLP/NSP solver ralg

some changes for ralg have been committed, they affect both trajectory and stop criteria (for constrained problems).

Scaling

Possibility to use scale factor(s) is undoubtedly a "MUST HAVE" feature for any advisable optimization solver or framework.

Since now scaling is available in OO (update from svn or tarball is required), and example of scale factor usage (p.scale, "scaleFactor" is too long to type) has been committed to OO Doc page.

Note that using of p.diffInt as vector is also allowed.
However, using scale is more preferred: it affects xtol for those solvers who use native OO stop criteria (ralg, lincher, nssolve, nsmm, mb some else).

Tuesday, February 5, 2008

MMP solver nsmm: constraints have been implemented

constraints handling for MMP (minimax problem) solver nsmm has been implemented.
Here's text and graphical output of the updated mmp example

starting solver nsmm (license: BSD) with problem unnamed
Niter ObjFun log10(maxResidual)
0 6.47e+03 1.9
10 6.45e+03 -1.1
20 6.46e+03 -3.6
30 6.46e+03 -5.8
nsmm has finished solving the problem unnamed
istop: 3 (|| X[k] - X[k-1] || < xtol)
Solver: Time Elapsed = 0.26 CPU Time Elapsed = 0.21
Plotting: Time Elapsed = 3.56 CPU Time Elapsed = 2.99
objFunValue: 6461.0983572120513 (feasible, max constraint = 9.66019e-07)

Sunday, February 3, 2008

bugfix for some scipy NLP solvers (unconstrained)

Another one bugfix have been committed (appered due to some recent svn changes for scipy_cg, scipy_ncg, scipy_powell, scipy_bfgs, scipy_fminbound).
Thanks to Nils Wagner for reporting the issue.
That one was due to definition of exception "isSolved" migrated from BaseProblem.py to ooMisc.py

[Linux] ALGENCAN bug, maybe due to latest glibc

Some days ago I have accepted a proposition for glibc recent version installation from Ubuntu software updates channel, and I guess it's the matter for the bug (while starting ALGENCAN):
StdErr: *** glibc detected *** /usr/bin/python: free(): invalid pointer:
0x00000000008362f0 ***