Wednesday, February 8, 2012

Difference between parameters and variables

Hi ampl users,

I got a new question. Since AMPL does not allow command like "if....
then...", my question is :

how to convert the following sentence into a constrain which is
acceptable by AMPL.

For example,

set i
set j

param a (i,j)

var b (i,j)

#constrain

if b (i,j) > 0, then a (i,j) < 30

If you are using a modeling systems such as AMPL, one of the first concepts you need to understand is the role of parameters and variables. As long as you don’t understand this, there is probably very little you can actually write down correctly.

Here is another example: http://social.msdn.microsoft.com/Forums/en-US/solverfoundation/thread/e5aeecb0-b411-41c9-b2d1-30926290b9ff

1 comment: