root/trunk/openopt/scikits/openopt/examples/glp_2.py

Revision 1589, 374 bytes (checked in by dmitrey.kroshko, 3 weeks ago)

minor changes

  • Property svn:executable set to *
Line 
1 from scikits.openopt import GLP
2 from numpy import *
3
4 f = lambda x: (x[0]-1.5)**2 + sin(0.8 * x[1] ** 2 + 15)**4 + cos(0.8 * x[2] ** 2 + 15)**4 + (x[3]-7.5)**4
5 p = GLP(f, lb = -ones(4),  ub = ones(4),  maxIter = 1e3,  maxFunEvals = 1e5,  maxTime = 3,  maxCPUTime = 3)
6
7 #optional: graphic output
8 #p.plot = 1
9
10 r = p.solve('pswarm', plot=1, debug=1)
11 x_opt,  f_opt = r.xf,  r.ff
Note: See TracBrowser for help on using the browser.