Closed raphaelchenouard closed 4 years ago
Yes, loup finders ignore integrality constraints. This constraint is actually represented by an equation saw(x)=0 where saw is a regular function over the reals. The problem you have is that this equation, as all others, is relaxed by the optimizer to a pair of inequalities -eps<=saw(x)<=eps, whence the slight interval around each integers.
If you want to have precise integers in the solution, i.e. no relaxation, try to run ibexopt with --rigor
.
There's nothing I can do much (handling integer variables explicitly in ibex is not considered so far as an option).
I let you close the issue if you think is OK for you.
Thanks for the tip with rigor mode, I forgot it.
It should be interesting if integer constraints can't be relaxed like other equations and without using the rigor mode explicitly.
Given this model: ` / Principles of Optimal Design: Modeling and Principles. Papalambros and Wilde, p61-66, 3rd edition, Cambridge. / constants L1 = 0.405; // Length of gear/drive screw interface segment (in) C_m = 1; //material cost ($/in3) sigma_all = 20000; //maximum allowable bending stress (psi) tau_all = 22000; //maximum allowable shear stress (psi) f = 0.35; // friction coefficient for steel on plastic variables d1 in [0.1,0.625]; // diameter of the gear/drive screw interface (in) d2 in [0.1,0.625]; // diameter of the thread (in) d3 in [0.1,0.625]; // diameter of the bearing surface segment (in) L2 in [7.023,7.523]; // length of the thread (in) L3 in [1.1525,1.6525]; // length of the bearing surface segment (in) N_m in [8,100]; // number of teeth of the motor gear N_s in [1,52]; // number of teeth of the screw N_T in [1,24]; // numbre of threads per inch
minimize C_m(pi/4)(0.405d1^2 + d2^2L2 + d3^2*L3);
constraints 38.88 + 96L2 + 96L3 - pisigma_alld2^3 <= 0; 6(N_s/N_m) - pitau_all*d1^3 <= 0; 8.345 - L2 - L3 <= 0; -9.595 + L2 + L3 <= 0;
5(N_m/N_s) - 0.0583N_T <= 0; 1.5d2(pifd2+0.5N_T^-1)/(0.5pid2-fN_T^-1) - 0.125*(N_s/N_m) <= 0;
d3<=d2; d1<=d2;
integer(N_m); integer(N_T); integer(N_s); end `
Using ibexopt 2.8.6, I obtain the following result: ` optimization successful!
f* in [0.323942927233,0.32426687016] (best bound)
x* = (0.100000000001 ; 0.237337563216 ; 0.100000000001 ; 7.02300000001 ; 1.32200000101 ; 13.999999991 ; 50.999999995 ; 23.999999991) (best feasible point)
relative precision on f: 0.001 [passed] absolute precision on f: 0.000323942927233 cpu time used: 0.0323100000001s number of cells: 46 `
The 3 last variables are constrained by an integer constraint but it seems useless for the loup finder. I suppose that this information is not easily accessible in the loup finder and it only consider real variables.