Re: Numerical solver



Laszlo Zsolt Nagy wrote:
Hello,

I would like to use a numerical solver for a specific problem. My
problem looks like this:

1. I have numeric constants, named A,B,C etc.
2. I have numeric variables, named x,y,z etc.
3. I have functions, like f1(x), f2(x), f3(x,y), f4(y) etc.
4. I have constraints like f1(x) < A f3(x,y) < B etc.

Fortunately, all of the variables can be limited to a closed finite
interval. (E.g. 0 <= x <= 100)
There is a specific function, called P(x,y,z) that needs to be optimized
(need to find its maximum/minimum).

In [7]: scipy.optimize.fmin_cobyla?

Type: function
Base Class: <type 'function'>
String Form: <function fmin_cobyla at 0x4fff3b0>
Namespace: Interactive
File:
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/scipy-
0.4.7.1607-py2.4-macosx-10.4-ppc.egg/scipy/optimize/cobyla.py
Definition: scipy.optimize.fmin_cobyla(func, x0, cons, args=(),
consargs=None, rhobeg=1.0, rhoen
d=0.0001, iprint=1, maxfun=1000)
Docstring:
Minimize a function using the Contrained Optimization BY Linear
Approximation (COBYLA) method

Arguments:

func -- function to minimize. Called as func(x, *args)

x0 -- initial guess to minimum

cons -- a sequence of functions that all must be >=0 (a single function
if only 1 constraint)

args -- extra arguments to pass to function

consargs -- extra arguments to pass to constraints (default of None means
use same extra arguments as those passed to func).
Use () for no extra arguments.

rhobeg -- reasonable initial changes to the variables

rhoend -- final accuracy in the optimization (not precisely guaranteed)

iprint -- controls the frequency of output: 0 (no output),1,2,3

maxfun -- maximum number of function evaluations.


Returns:

x -- the minimum

--
Robert Kern
robert.kern@xxxxxxxxx

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter

.



Relevant Pages

  • Re: upper and lower bounds as constraints?
    ... the optimization is also over the weights mentioned in the beginning ... The objective function is a sum of quantum probabilities given as ... THere is 1 equality constraint of similar ... any advice would be appreciated. ...
    (comp.soft-sys.matlab)
  • Re: Scaling in fmincon()
    ... > I have been using the Matlab constrained optimization fucntion(). ... does anyone know if Matlab fmincon() does any scaling at all? ... I'll form two objectives, ... Iter F-count fconstraint Step-size derivative ...
    (comp.soft-sys.matlab)
  • Re: Numerical Recipes (Fortran) Usenet ??
    ... optimization, particularly when the desired solution happens to ... occur right on a constraint boundary, or at an intersection of ... It isn't a Fortran matter. ...
    (comp.lang.fortran)
  • Re: Need help with fmincon and fminunc
    ... fmincon,and when I run the optimization program,this ... The default in fmincon is to use the largescale ... 1.I don't have any constraint function.However,I have the ... Fminunc has no ability to use constraints. ...
    (comp.soft-sys.matlab)
  • Re: Optimization code in Matlab and choice of penalty function
    ... The optimization toolbox in Matlab ... TOMLAB is a continuously evolving package that will cover your ... and the constraint is this: ...
    (comp.soft-sys.matlab)