expanding defined variables

21 views
Skip to first unread message

Ali Baharev

unread,
Nov 5, 2009, 11:53:22 AM11/5/09
to am...@googlegroups.com
I would like to transform my benchmarks into a form that can be used
by other researchers not using AMPL. (In my highly biased opinion they
should be using AMPL :) )

I would like to expand the model sent to the solver after presolve and
i would like to achieve that in an automated manner.

I am almost happy with "solexpand _scon;" and "option auxfiles cfr;"
with one notable exception. The expressions are not shown for those
variables in the .fix file that are not fixed to a constant value. How
can i "expand" those defined variables in an automated manner?

Any help is appreciated.

Ali

Robert Fourer

unread,
Nov 5, 2009, 11:15:34 PM11/5/09
to am...@googlegroups.com, Ali Baharev

This is true, the definitions of defined variables are not expanded. To
export the problem using "expand" or "solexpand" you would have to replace
these definitions by explicit constraints of the form <var> = <defining
expression>.

Bob Fourer
4...@ampl.com

Ali Baharev

unread,
Nov 6, 2009, 12:59:19 PM11/6/09
to 4...@ampl.com, am...@googlegroups.com
Thank you for the response.

Unfortunately it is still not what I have been looking for. They still
do not appear in the .fix file.

Are you suggesting that I should also expand the "defined variable"
explicit constraints and then copy the corresponding part of the
constraint to the .fix file with an appropriate script?

Is there another way to avoid writing a script for that?

Ali Baharev

unread,
Nov 17, 2009, 4:31:51 AM11/17/09
to 4...@ampl.com, am...@googlegroups.com
David M. Gay suggested this (with the <var> = <defining expression>
explicit constraint approach):

expand{i in 1.._nvars: _var[i].status == 'sub'} _con[_var[i].defeqn];

It works but Lambda[1,1,1] appears in def_sum_xLambda[1,1]
however Lambda[1,1,1] is 1 and should be eliminated.

In other words: the output still needs considerable editing.

It seems to me that the easiest would be to write a custom parser for
the nl file.

Many thanks for the help,

Ali
Reply all
Reply to author
Forward
0 new messages