Free Python optimization framework

Friday, July 25, 2008

non-linear functions with restricted dom

Some non-linear functions have much more restricted dom than R^nVars.
For example F(x) = log(x); dom F = R+ = {x: x>0}

I had posted a small manual of using ralg with the problems (via +inf and contol shift), however, optimization solvers wont to expect user-povided F(x) = nan (if x is out of dom).

So I have made ralg handling doms in accordance with the mentioned standard; now there are no needs to do that contol shift mentioned, and using [numpy.]nan instead of +inf is recommended.

An example has been attached to OO Doc Page.

Note also that some solvers (BTW all connected to OO except of ralg) require x0 from dom(objFunc).
As for ralg it doesn't matter, provided for each point x out of dom objFunc there is at least one active constraint (usually lb<=x<=ub are used, but any other constraints, including non-linear, are OK).

Note: some ralg iters have objFunc = nan:

solver: ralg problem: unnamed goal: minimum
iter objFunVal log10(maxResidual)
0 1.925e+04 -100.00
50 nan 1.32
100 nan -0.26
150 1.045e+03 -100.00
200 1.027e+03 -100.00
250 nan -3.49
300 nan -3.19
350 1.016e+03 -100.00
400 nan -5.20
450 nan -6.75
500 nan -5.72
550 nan -5.91
555 1.015e+03 -100.00
istop: 4 (|| F[k] - F[k-1] || < ftol)
Solver: Time Elapsed = 2.45 CPU Time Elapsed = 2.37
objFunValue: 1015.082 (feasible, max constraint = 0)

No comments: