Show
Ignore:
Timestamp:
01/30/2012 07:40:08 PM (4 months ago)
Author:
dmitrey
Message:

minor change for interalg example

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • PythonPackages/FuncDesigner/FuncDesigner/examples/exactGlobalMINLP.py

    r1375 r1378  
    77n = 7 
    88x = oovars(n) 
     9for i in range(n): 
     10    x[i](str(i)) 
    911x[4].domain = [0.9, -0.7, 0.4] # let's set one of x coords as  discrete variable 
    1012y = oovar(domain = bool) # the same to domain = [0,1] 
     
    1719               (x[0]**2 + x[1]**2 == 0.5)(tol=1.0e-7),  
    1820               (x[1]**2 + 0.71*x[1]**2 + (x[2]-0.02)**2 <= 0.17)(tol=1e-4),  
    19                (x[2]-0.1)**2 + (x[3]-0.03)**2 <= 0.01,  # default constraint tol is 10^-6 
     21               (x[2]-0.1)**2 + (x[3]-0.03)**2 <= 0.0009,  # default constraint tol is 10^-6 
    2022               cos(y) + x[5] <= -0.1,  
    2123               z**2 +arctan(x[1]) < 16,  
    22                interpolator([1, 2, 3, 4], [1.001, 4, 9, 16.01])(x[4]+2*x[5]) < 6 
     24               interpolator([1, 2, 3, 4], [1.001, 4, 9, 16.01])(3+x[4]+x[5]) < 20 
    2325               ] 
    2426 
     
    4345 iter   objFunVal   log10(MaxResidual/ConTol)    
    4446    0  9.890e-01                      6.70  
    45   100  -2.571e-01                     -1.20  
    46   200  -2.910e-01                     -0.47  
    47   300  -2.910e-01                     -0.47  
    48   400  -2.926e-01                     -0.22  
     47  100  -2.616e-01                     -0.37  
    4948OpenOpt info: Solution with required tolerance 5.0e-04  
    5049 is guarantied (obtained precision: 5.0e-04) 
    51   409  -2.926e-01                     -0.22  
     50  190  -2.669e-01                     -0.15  
    5251istop: 1000 (solution has been obtained) 
    53 Solver:   Time Elapsed = 37.75         CPU Time Elapsed = 37.01 
    54 objFunValue: -0.29255101 (feasible, max(residuals/requiredTolerances) = 0.59926
    55 [[-0.63428688049307214, -0.31253814696507071, 0.074464532391391849, -0.066528274992712286,  
    56 -0.69999999999999996, -0.88575384524595291, 0.89992401222574525], 1.0, 4.0] 
     52Solver:   Time Elapsed = 12.42         CPU Time Elapsed = 11.86 
     53objFunValue: -0.26687054 (feasible, max(residuals/requiredTolerances) = 0.709678
     54[[-0.63549995422337446, -0.31006431453795402, 0.0947155871999006, 0.0004902022309690152,  
     55-0.69999999999999996, -0.99903866874298164, 0.89991287060890723], 1.0, 4.0] 
    5756'''