Thank you very much Grey. Very interesting solution I did not think of it like this before. I was wondering about the following it would be nice if you have any comments to share. I want to use one of the algorithms which uses derivatives. And for those if I implement the derivative of the rounding constraints (where C_i are the rounding constraints for each i=1 to N) as d C_i/ dx_i = if ( x_i - 0.01* integer part (x_i/0.01) + 0.005) < epsilon then huge_value else 0.
i.e. i am trying to mimic a delta function at the points where the function jumps and zero elsewhere. do you think numerically i run into instability issues or any other convergence issues. Best Kaushik On Mon, May 15, 2017 at 2:32 PM, Grey Gordon <[email protected]> wrote: > Hi Kaushik, > > You can do this with the Augmented Lagrangian algorithm. One way to do > constraint #2 is like (x_i-.00) * (x_i-.01) * … * (x_i-1.00) = 0. This may > suffer from instability. An alternative would be > min(|x_i-.00|,|x_i-.01|,…,|x_i-1|) = 0. This is more stable but may > perform worse. > > Best, > Grey > > > On May 15, 2017, at 2:13 PM, Kaushik Matia <[email protected]> > wrote: > > > > Hi, > > > > I have optimization as follows: > > > > v = minimize sum_i sum_j x_i * x_j A_ij > > > > I have the following constraints: > > > > 1> sum_i x_i = 100% > > > > 2> x_i are rounded to the integer percents, e.g. 27.3% will become 27% > > > > My question is there a way to implement the rounding constraints. > > > > Thanks in advance. > > > > Best > > > > _______________________________________________ > > NLopt-discuss mailing list > > [email protected] > > http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss > >
_______________________________________________ NLopt-discuss mailing list [email protected] http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss
