Changeset 1066

Show
Ignore:
Timestamp:
06/27/08 15:50:21 (2 months ago)
Author:
dmitrey.kroshko
Message:

minor update in /examples/nlsp_constained.py (non-default ftol and contol)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openopt/scikits/openopt/examples/nlsp_constrained.py

    r920 r1066  
    13132. You can try using equality constraints (h(x)=0, Aeq x = beq) as well. 
    14143. Required function tolerance is p.ftol, constraints tolerance is p.contol, 
    15 and hence using h(x)=0 constraints is not 100% same  
     15and hence using h(x)=0 constraints is not 100% same 
    1616to some additional f coords 
    1717""" 
     
    2323#f = lambda x: (x[0]**3+x[1]**3-9, x[0]-0.5*x[1], cos(x[2])+x[0]-1.5) 
    2424f = (lambda x: x[0]**3+x[1]**3-9, lambda x: x[0]-0.5*x[1], lambda x: cos(x[2])+x[0]-1.5) 
    25 # Python list, numpy.array are allowed as well:  
     25# Python list, numpy.array are allowed as well: 
    2626#f = lambda x: [x[0]**3+x[1]**3-9, x[0]-0.5*x[1], cos(x[2])+x[0]-1.5] 
    2727#or f = lambda x: asfarray((x[0]**3+x[1]**3-9, x[0]-0.5*x[1], cos(x[2])+x[0]-1.5)) 
     
    3737    df[2,2] = -sin(x[2]) 
    3838    return df 
    39      
     39 
    4040x0 = [8,15, 80] 
    4141 
    42 #w/o gradient:  
     42#w/o gradient: 
    4343#p = NLSP(f, x0) 
    4444 
    45 p = NLSP(f, x0, df = df, maxFunEvals = 1e5, iprint = 10
     45p = NLSP(f, x0, df = df, maxFunEvals = 1e5, iprint = 10, plot=1, ftol = 1e-12, contol=1e-13
    4646 
    4747#optional: user-supplied gradient check: