Menu

[r4259]: / trunk / course / examples / scipy / example1.1  Maximize  Restore  History

Download this file

38 lines (25 with data), 1.1 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
>>> info(optimize.fmin)
fmin(func, x0, args=(), xtol=0.0001, ftol=0.0001, maxiter=None, maxfun=None,
full_output=0, printmessg=1)
Minimize a function using the simplex algorithm.
Description:
Uses a Nelder-Mead simplex algorithm to find the minimum of function
of one or more variables.
Inputs:
func -- the Python function or method to be minimized.
x0 -- the initial guess.
args -- extra arguments for func.
xtol -- relative tolerance
Outputs: (xopt, {fopt, warnflag})
xopt -- minimizer of function
fopt -- value of function at minimum: fopt = func(xopt)
warnflag -- Integer warning flag:
1 : 'Maximum number of function evaluations.'
2 : 'Maximum number of iterations.'
Additional Inputs:
xtol -- acceptable relative error in xopt for convergence.
ftol -- acceptable relative error in func(xopt) for convergence.
maxiter -- the maximum number of iterations to perform.
maxfun -- the maximum number of function evaluations.
full_output -- non-zero if fval and warnflag outputs are desired.
printmessg -- non-zero to print convergence messages.