Python: Scipy: brute optimization -


i getting error

typeerror: objfunc() missing 1 required positional argument: 'q'

when try brute optimize objective function.

what doing wrong?

def objfunc(p,q):     return p**3-2**q;  scipy.optimize import brute grid = (slice(1, 300, 1),slice(1, 300, 1)) solution = brute(objfunc, grid, finish=none,full_output = true) `enter code here`*typeerror: objfunc() missing 1 required positional argument: 'q'*''' 

thank you!

you need correct objfunc. range q high , may change prevent overflows

def objfunc(grid):     p, q = grid     return p**3-2**q;  grid = (slice(1, 300, 1),slice(1, 30, 1)) 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -