transferring the data between two parameters

Hello all !

I have the following problem:

I have a variable A(t1) /A1 12, A2 15, A3 18, A4 20/
I want to copy the first two elements in another variable B(t2) where t2 is /1,2/.

I am trying to make B(t2) /1 12, 2 15/

I can’t manage to do it… could you help ?

At the moment I am trying something like :
B(t2) = A(t1)$( ord(t1) = ord(t2) )
but it does not work because t1 is an “uncontrolled set entered as constant” and “set for ‘ord’ is not controlled”…

Thanks !


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/groups/opt_out.

Dear Jacques,

Try:

B(‘1’) = A(‘A1’);
B(‘2’) = A(‘A2’);


Cheers,
Pedro


On Thu, Jan 23, 2014 at 4:36 PM, Jacques wrote:

Hello all !

I have the following problem:

I have a variable A(t1) /A1 12, A2 15, A3 18, A4 20/
I want to copy the first two elements in another variable B(t2) where t2 is /1,2/.

I am trying to make B(t2) /1 12, 2 15/

I can’t manage to do it… could you help ?

At the moment I am trying something like :
B(t2) = A(t1)$( ord(t1) = ord(t2) )
but it does not work because t1 is an “uncontrolled set entered as constant” and “set for ‘ord’ is not controlled”…

Thanks !


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/groups/opt_out.



\

PEDRO JAVIER RAMÍREZ TORREALBA
Ingeniero Civil Eléctrico PUC
MSc en Ingeniería Eléctrica PUC
Londres, REINO UNIDO

Celular: +44-(0)75-8069-3119


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/groups/opt_out.

Hi,

I have been helped : here is the advise I was given : B(t2)(Ord(t2)<=2) = sum(ti(ord(t1)=ord(t2)),A(t1)) ;
the sum works.

However I have another problem now :

I want to assign to A the B (which I calculate in a loop).
I tried A(t1)=sum(t2$(ord(t2)= ord(t1) ), B(t2) );

It works, but is deletes the other variables I had in A…
as the guide says,
For an assignment statement with a dollar condition on the right hand side, an assignment is always
made. If the logical condition is not satised, the corresponding term that the logical dollar
condition is operating on evaluates to 0

… how can I deal with that ?

Thank you !!

Le jeudi 23 janvier 2014 17:36:10 UTC+1, Jacques a écrit :

Hello all !

I have the following problem:

I have a variable A(t1) /A1 12, A2 15, A3 18, A4 20/
I want to copy the first two elements in another variable B(t2) where t2 is /1,2/.

I am trying to make B(t2) /1 12, 2 15/

I can’t manage to do it… could you help ?

At the moment I am trying something like :
B(t2) = A(t1)$( ord(t1) = ord(t2) )
but it does not work because t1 is an “uncontrolled set entered as constant” and “set for ‘ord’ is not controlled”…

Thanks !


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/groups/opt_out.

Hi Jacques,

This are parameters of your model, right ? (value not calculated by the solver)

Is there any instance of the model where they have different values ?
Why wouldn’t you use the same name with $ conditions in the equations
? Perhaps it solves your problem in an easier way.

On the track that you’re currently using: Why don’t you try using a $
condition in the lhs of the assignment like you did before: i.e.

A(t1)$(Ord(t1) wrote:

Hi,

I have been helped : here is the advise I was given : B(t2)(Ord(t2) > sum(ti(ord(t1)=ord(t2)),A(t1)) ;
the sum works.

However I have another problem now :

I want to assign to A the B (which I calculate in a loop).
I tried A(t1)=sum(t2$(ord(t2)= ord(t1) ), B(t2) );

It works, but is deletes the other variables I had in A…
as the guide says,
For an assignment statement with a dollar condition on the right hand side,
an assignment is always
made. If the logical condition is not satis ed, the corresponding term that
the logical dollar
condition is operating on evaluates to 0

… how can I deal with that ?

Thank you !!

Le jeudi 23 janvier 2014 17:36:10 UTC+1, Jacques a écrit :

Hello all !

I have the following problem:

I have a variable A(t1) /A1 12, A2 15, A3 18, A4 20/
I want to copy the first two elements in another variable B(t2) where t2
is /1,2/.

I am trying to make B(t2) /1 12, 2 15/

I can’t manage to do it… could you help ?

At the moment I am trying something like :
B(t2) = A(t1)$( ord(t1) = ord(t2) )
but it does not work because t1 is an “uncontrolled set entered as
constant” and “set for ‘ord’ is not controlled”…

Thanks !


“gamsworld” group.
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/groups/opt_out.

\