The Ord of the first element if a set is 1. You could in this case also use t.Val which will give you the value if the set elements are numberstill

Cheers

renger

Sent from my Samsung Note 4

-------- Original message --------

From: Stevie Lochran

Date: 18/05/2015 08:26 (GMT+01:00)

To: gamsworld@googlegroups.com

Subject: Re: Assigning bounds to multiple elements within a set

Hi Regner.

Apologies for reposting,but this did not seem to work (i thought it had).

If I want to assign a lower bound of value 195 on the variable flow (a,i,j,t) for all years 2010-2021

With the specific indices flow(‘105’, ‘Hungary’, ‘Serbia’, 2010 *2021)

Where set t = 2010*2050,

From your previous post I derived the following:

flow.lo(‘105’,‘Hungary’,‘Serbia’,t)$(ord(t) > 2009 and ord(t) < 2021 ) = 195;

I get no error message, but the model doesn’t obey the lower bound on flow. It obeys the general bounds specified earlier in the model which should, as I understand it, be overwritten by this one.

Any ideas what am I doing wrong here?

Thanks,

Stevie

On Thursday, May 14, 2015 at 9:31:19 AM UTC+1, Stevie Lochran wrote:

Hey all,

I was wondering if someone might be able to help with a small syntax problem?

I have a parameter

a_data(a,i,j,t,ac)

with

a /1*200/;

And on set a, I want to impose a lower bound of 2500 on a range of elements , from 166 to 170.

Aside from using the following:

flow.lo(‘166’,i,j,t)= 2500;

flow.lo('167,i,j,t)= 2500;

flow.lo(‘168’,i,j,t)= 2500;

Is there an easier way to do it, other than creating subsets each time?

Thanks

## Stevie

\

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.