Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AMPL bug when reading file s365mod.nl #2

Open
bneveu opened this issue Jan 16, 2019 · 3 comments
Open

AMPL bug when reading file s365mod.nl #2

bneveu opened this issue Jan 16, 2019 · 3 comments

Comments

@bneveu
Copy link

bneveu commented Jan 16, 2019

The variables x(2]nd x(3) are exchanged when reading the file s365mod.nl (in the coconut series2 benchmark)
The created system in ibexopt does not correspond to the input file
in particular the objective becomes
goal: (x(1)*x(2))
instead of (x(1)*x(3))
and the constraints
constraints:
(((x(5)-x(7))^2+(x(4)-x(6))^2)-4)>=0
((((x(2)*x(4))-(x(3)*x(5)))/(x(2)^2+sqrt(x(3)^2)))-1)>=0
((((x(2)*x(6))-(x(3)*x(7)))/(x(2)^2+sqrt(x(3)^2)))-1)>=0
((((((x(3)-x(1))*x(5))+(x(1)*x(2)))-(x(2)*x(4)))/((x(3)-x(1))^2+sqrt(x(2)^2)))-1)>=0
((((((x(3)-x(1))*x(7))+(x(1)*x(2)))-(x(2)*x(6)))/((x(3)-x(1))^2+sqrt(x(2)^2)))-1)>=0

instead of
constraints:
(((x(4)-x(6))^2+(x(5)-x(7)^2)-4)>=0
((((x(3)*x(4))-(x(2)*x(5)))/(sqrt(x(2)^2)+x(3)^2))-1)>=0
((((x(3)*x(6))-(x(2)*x(7)))/(sqrt(x(2)^2)+x(3)^2))-1)>=0
(((((x(1)*x(3))+((x(2)-x(1))*x(5)))-(x(3)*x(4)))/(sqrt(x(3)^2)+(x(2)-x(1))^2))-1)>=0
(((((x(1)*x(3))+((x(2)-x(1))*x(7)))-(x(3)*x(6)))/(sqrt(x(3)^2)+(x(2)-x(1))^2))-1)>=0

@bneveu
Copy link
Author

bneveu commented Jan 16, 2019

The ampl generator of .nl files may change the variable order : it is then a little complicated
to bound them manually and to check the solution.
I think it is better to let the unbounded variables in the problem definition unbounded in the .nl file and
to bound them if necessary at the beginning of the optimization process.

@bneveu bneveu closed this as completed Jan 16, 2019
@gchabert
Copy link

Good to know!
Thanks Bertrand

@Jordan08
Copy link
Member

Hello,
I just saw the bug.
Indeed, AMPL chooses the order of the variables.
The problem does not come from this reordering. When the bounds are in the model, they are well affected.
The problem is that variable names are not keeping. It is necessary to modify the interfaceAMPL to recover the names of the variables from the model AMPL.
(I did not do it because I do not know how to do it yet)

If we put the bounds outside the model, it will be problematic. Because some bounds are given in the modeling like constraints, and they are interpreted by AMPL as bounds.
In fact, the bounds are really part of the model. If we evacuate them from the model, the risk is to lose information (it has already happened to me ....)

To investigate ... from where the reopening of the bug ...

@Jordan08 Jordan08 reopened this Jan 25, 2019
Jordan08 referenced this issue in ibex-team/ibex-lib Jun 6, 2019
extract from .nl if the following option are activate in Ampl original
file: "option ibexopt_auxfiles rc;"
@gchabert gchabert transferred this issue from ibex-team/ibex-lib Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants