indexed objective variable

Hi,

Does anyone know how to solve a model with an indexed objective variable for all indices in a loop?

As a simple example:

set k /13/;
variables x(k),y(k);
equation defy(k);
defy(k)… y(k) =e= 2
(x(k)**2) + 1;
model test /all/;

loop(k,
solve test using nlp min y(k);
);

Thanks,
Hossein


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

Hi Hossein
Write:

set k /13/
o(k);
variables x(k),y;
equation defy(k);
defy(o)… y=e= 2
(x(o)**2) + 1;
model test /all/;

loop(k,
o(k)=yes;
solve test using nlp min y;display y.l;
o(k)=no;
);

On Fri, Aug 28, 2015 at 9:37 PM, hossein noruzoliaee wrote:

Hi,

Does anyone know how to solve a model with an indexed objective variable for all indices in a loop?

As a simple example:

set k /13/;
variables x(k),y(k);
equation defy(k);
defy(k)… y(k) =e= 2
(x(k)**2) + 1;
model test /all/;

loop(k,
solve test using nlp min y(k);
);

Thanks,
Hossein


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

\

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.