[SciPy-User] [SciPy-user] Constrained optimizing - how to setup?

bevan j bevan07@gmail....
Wed Nov 17 20:34:30 CST 2010


Hello, 

I have an optimization issue that I cannot get my head around.  I think it
is likely that i need to reformat/change my functions (in addition to using
a constrained solver) 

The example below is what I currently have, however, I would to constrain
'term1','term2', and 'term3' to >= 0.01 

def myerr(params,r1,r2,r3,x1,x2,x3,x4): 
    term1 = myfunc(r1, params[0], params[1], x1, x2) 
    term2 = myfunc(r2, params[0], params[1], x1, x3) 
    term3 = myfunc(r3, params[0], params[1], x1, x4) 
    er1 = (term1 - term2)**2 
    er2 = (term2 - term3)**2 
    return er1+er2 

v = optimize.fmin(myerr, v0,
args=(self.r1,self.r2,self.r3,self.x1,self.x2,self.x3,self.x4),maxiter=10000,
maxfun=10000) 

I hope this clear enough, any tips, v. much appreciated. 

Bevan 

-- 
View this message in context: http://old.nabble.com/Constrained-optimizing---how-to-setup--tp30239359p30239359.html
Sent from the Scipy-User mailing list archive at Nabble.com.



More information about the SciPy-User mailing list