Can you give an example of the constraint that you want to write? Be sure to indicate which symbols are parameters (data) and which are decision variables.
Bob Fourer
From: am...@googlegroups.com [mailto:am...@googlegroups.com]
On Behalf Of Aliya Awais
Sent: Thursday, September 5, 2013 9:27 AM
To: am...@googlegroups.com
Subject: [AMPL 7425] LCM
var Use {size} integer >= 0;
var U {size} integer >= 0;
subject to Width_Limit:
sum {i in size} widths[i] * floor( U[i] )<= r;
subject to Length_Limit {i in size} :
Use[i]= (U[i])*/lengths[i]) *lcm(floor(U[541])*lengths[541],floor(U[521])*lengths[521],floor(U[501])*lengths[501],floor(U[481])*lengths[481]);
--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To post to this group, send email to am...@googlegroups.com.
Visit this group at http://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/groups/opt_out.
There are solvers such as KNITRO, Bonmin, and Couenne that accept mixed-integer nonlinear problems. You could try them, but I think you may find that they do not handle the lcm function successfully. These solvers rely on "relaxations" of the problem in which some variables are allowed to take fractional values; so to fit the framework that these solvers require, you would need to extend lcm to a continuous function on fractional as well as integer values, which I doubt is possible.
Although your formulation may be mathematically correct, and it is certainly concise, it may not be in a form that lends itself to solution by current techniques. You may need to rethink the formulation to get one that can be usefully solved, perhaps using a greater number of variables and (hopefully linear) constraints. I can't be more definite than that since I'm not sure what application you are trying to model.
In any case it is not useful to write expressions like "floor(U[i])" where U[i] is already defined to be integer. (For an integer variable U[i], floor(U[i]) = U[i].)
On Behalf Of Aliya Awais
Sent: Monday, September 9, 2013 7:36 AM
To: am...@googlegroups.com
Subject: Re: [AMPL 7431] LCM