Changeset 1378 for PythonPackages/FuncDesigner
- Timestamp:
- 01/30/2012 07:40:08 PM (4 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
PythonPackages/FuncDesigner/FuncDesigner/examples/exactGlobalMINLP.py
r1375 r1378 7 7 n = 7 8 8 x = oovars(n) 9 for i in range(n): 10 x[i](str(i)) 9 11 x[4].domain = [0.9, -0.7, 0.4] # let's set one of x coords as discrete variable 10 12 y = oovar(domain = bool) # the same to domain = [0,1] … … 17 19 (x[0]**2 + x[1]**2 == 0.5)(tol=1.0e-7), 18 20 (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.0 1, # default constraint tol is 10^-621 (x[2]-0.1)**2 + (x[3]-0.03)**2 <= 0.0009, # default constraint tol is 10^-6 20 22 cos(y) + x[5] <= -0.1, 21 23 z**2 +arctan(x[1]) < 16, 22 interpolator([1, 2, 3, 4], [1.001, 4, 9, 16.01])( x[4]+2*x[5]) < 624 interpolator([1, 2, 3, 4], [1.001, 4, 9, 16.01])(3+x[4]+x[5]) < 20 23 25 ] 24 26 … … 43 45 iter objFunVal log10(MaxResidual/ConTol) 44 46 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 49 48 OpenOpt info: Solution with required tolerance 5.0e-04 50 49 is guarantied (obtained precision: 5.0e-04) 51 409 -2.926e-01 -0.2250 190 -2.669e-01 -0.15 52 51 istop: 1000 (solution has been obtained) 53 Solver: Time Elapsed = 37.75 CPU Time Elapsed = 37.0154 objFunValue: -0.2 9255101 (feasible, max(residuals/requiredTolerances) = 0.59926)55 [[-0.63 428688049307214, -0.31253814696507071, 0.074464532391391849, -0.066528274992712286,56 -0.69999999999999996, -0. 88575384524595291, 0.89992401222574525], 1.0, 4.0]52 Solver: Time Elapsed = 12.42 CPU Time Elapsed = 11.86 53 objFunValue: -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] 57 56 '''
