how to copy values from set to another set?

hi,

i’d like to copy values from tax1(a) to tax2(c). but i got an error message “Uncontrolled set entered as constant”
how can i achieve my purpose?


set a /a1,a2,a3/;
set c /c1,c2,c3/;

tax1(a);
*tax1(a) has been initialized;
tax2(c);

tax2(c)=tax1(a);


Many thanks



\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/fsmSFWCTQx8J.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

tax2(‘c1’)=e=tax(‘a1’);
On Aug 27, 2012 3:05 PM, “WeiLiang” wrote:

hi,

i’d like to copy values from tax1(a) to tax2(c). but i got an error message “Uncontrolled set entered as constant”
how can i achieve my purpose?


set a /a1,a2,a3/;
set c /c1,c2,c3/;

tax1(a);
*tax1(a) has been initialized;
tax2(c);

tax2(c)=tax1(a);


Many thanks



\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/fsmSFWCTQx8J.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Hi
set a /a1,a2,a3/;
set c /c1,c2,c3/;

tax1(a);
*tax1(a) has been initialized;
tax2(c);

Loop((a,c),tax2(c)$(ord(c)=Ord(a))=tax1(a));


On Mon, Aug 27, 2012 at 11:49 AM, Nan Yu wrote:

tax2(‘c1’)=e=tax(‘a1’);
On Aug 27, 2012 3:05 PM, “WeiLiang” wrote:

hi,

i’d like to copy values from tax1(a) to tax2(c). but i got an error message “Uncontrolled set entered as constant”
how can i achieve my purpose?


set a /a1,a2,a3/;
set c /c1,c2,c3/;

tax1(a);
*tax1(a) has been initialized;
tax2(c);

tax2(c)=tax1(a);


Many thanks



\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/fsmSFWCTQx8J.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Alireza Bahari,

it’s great! thanks a lot!

i got another problem. i wnat to put “Loop((a,c),tax2(c)$(ord(c)=Ord(a))=tax1(a));” into an equation. but return an error message “Equation definition within a LOOP or IF statement not allowed”.

How should I do?


在 2012年8月27日星期一UTC+8下午4时20分40秒,Alireza Bahari写道:

Hi
set a /a1,a2,a3/;
set c /c1,c2,c3/;

tax1(a);
*tax1(a) has been initialized;
tax2(c);

Loop((a,c),tax2(c)$(ord(c)=Ord(a))=tax1(a));


On Mon, Aug 27, 2012 at 11:49 AM, Nan Yu wrote:

tax2(‘c1’)=e=tax(‘a1’);
On Aug 27, 2012 3:05 PM, “WeiLiang” wrote:

hi,

i’d like to copy values from tax1(a) to tax2(c). but i got an error message “Uncontrolled set entered as constant”
how can i achieve my purpose?


set a /a1,a2,a3/;
set c /c1,c2,c3/;

tax1(a);
*tax1(a) has been initialized;
tax2(c);

tax2(c)=tax1(a);


Many thanks



\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/fsmSFWCTQx8J.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/StyyTI7-WZYJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Alireza Bahari,
it’s great! thanks a lot!
i got another problem. i wnat to put “Loop((a,c),tax2(c)$(ord(c)=Ord(a))=tax1(a));” into an equation.

for example:

eqEquation$ord(a)=Ord(i)… tax2(c)=e=tax1(a);


but return an error message “Equation definition within a LOOP or IF statement not allowed”.
How should I do?



在 2012年8月27日星期一UTC+8下午4时20分40秒,Alireza Bahari写道:

Hi
set a /a1,a2,a3/;
set c /c1,c2,c3/;

tax1(a);
*tax1(a) has been initialized;
tax2(c);

Loop((a,c),tax2(c)$(ord(c)=Ord(a))=tax1(a));


On Mon, Aug 27, 2012 at 11:49 AM, Nan Yu wrote:

tax2(‘c1’)=e=tax(‘a1’);
On Aug 27, 2012 3:05 PM, “WeiLiang” wrote:

hi,

i’d like to copy values from tax1(a) to tax2(c). but i got an error message “Uncontrolled set entered as constant”
how can i achieve my purpose?


set a /a1,a2,a3/;
set c /c1,c2,c3/;

tax1(a);
*tax1(a) has been initialized;
tax2(c);

tax2(c)=tax1(a);


Many thanks



\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/fsmSFWCTQx8J.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/ieIMibPqeOEJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Hi
Equations Equ1;

Equ1(c,a)$(Ord(a)=Ord(c))… tax2(c)=e=tax1(a);

On Mon, Aug 27, 2012 at 3:21 PM, WeiLiang wrote:

Alireza Bahari,

it’s great! thanks a lot!

i got another problem. i wnat to put “Loop((a,c),tax2(c)$(ord(c)=Ord(a))=tax1(a));” into an equation. but return an error message “Equation definition within a LOOP or IF statement not allowed”.

How should I do?


在 2012年8月27日星期一UTC+8下午4时20分40秒,Alireza Bahari写道:

Hi
set a /a1,a2,a3/;
set c /c1,c2,c3/;

tax1(a);
*tax1(a) has been initialized;
tax2(c);

Loop((a,c),tax2(c)$(ord(c)=Ord(a))=tax1(a));


On Mon, Aug 27, 2012 at 11:49 AM, Nan Yu wrote:

tax2(‘c1’)=e=tax(‘a1’);
On Aug 27, 2012 3:05 PM, “WeiLiang” wrote:

hi,

i’d like to copy values from tax1(a) to tax2(c). but i got an error message “Uncontrolled set entered as constant”
how can i achieve my purpose?


set a /a1,a2,a3/;
set c /c1,c2,c3/;

tax1(a);
*tax1(a) has been initialized;
tax2(c);

tax2(c)=tax1(a);


Many thanks



\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/fsmSFWCTQx8J.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/StyyTI7-WZYJ.

To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Alireza Bahari,

Thanks! it’s works.

sorry to trouble you again. when i write a line code like below, it can not work.

Equ1(c,a)$(Ord(a)=Ord(c))… tax2(i,c)=e=tax1(i,a);

Notice: tax2(i,c) and tax1(i,a) are two-dimensional sets.

How should I write the code?

thanks!!!



在 2012年8月27日星期一UTC+8下午9时40分46秒,Alireza Bahari写道:

Hi
Equations Equ1;

Equ1(c,a)$(Ord(a)=Ord(c))… tax2(c)=e=tax1(a);

On Mon, Aug 27, 2012 at 3:21 PM, WeiLiang wrote:

Alireza Bahari,

it’s great! thanks a lot!

i got another problem. i wnat to put “Loop((a,c),tax2(c)$(ord(c)=Ord(a))=tax1(a));” into an equation. but return an error message “Equation definition within a LOOP or IF statement not allowed”.

How should I do?


在 2012年8月27日星期一UTC+8下午4时20分40秒,Alireza Bahari写道:

Hi
set a /a1,a2,a3/;
set c /c1,c2,c3/;

tax1(a);
*tax1(a) has been initialized;
tax2(c);

Loop((a,c),tax2(c)$(ord(c)=Ord(a))=tax1(a));


On Mon, Aug 27, 2012 at 11:49 AM, Nan Yu wrote:

tax2(‘c1’)=e=tax(‘a1’);
On Aug 27, 2012 3:05 PM, “WeiLiang” wrote:

hi,

i’d like to copy values from tax1(a) to tax2(c). but i got an error message “Uncontrolled set entered as constant”
how can i achieve my purpose?


set a /a1,a2,a3/;
set c /c1,c2,c3/;

tax1(a);
*tax1(a) has been initialized;
tax2(c);

tax2(c)=tax1(a);


Many thanks



\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/fsmSFWCTQx8J.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/StyyTI7-WZYJ.

To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/NCMkAlKhFFYJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Just include i in equation definition like
Eq(i,c,a)$(ord(c) eq ord(a))…tax(i,c) = tax (i,a)
On 27 Aug 2012 21:13, “WeiLiang” wrote:

Alireza Bahari,

Thanks! it’s works.

sorry to trouble you again. when i write a line code like below, it can not work.

Equ1(c,a)$(Ord(a)=Ord(c))… tax2(i,c)=e=tax1(i,a);

Notice: tax2(i,c) and tax1(i,a) are two-dimensional sets.

How should I write the code?

thanks!!!



在 2012年8月27日星期一UTC+8下午9时40分46秒,Alireza Bahari写道:

Hi
Equations Equ1;

Equ1(c,a)$(Ord(a)=Ord(c))… tax2(c)=e=tax1(a);

On Mon, Aug 27, 2012 at 3:21 PM, WeiLiang wrote:

Alireza Bahari,

it’s great! thanks a lot!

i got another problem. i wnat to put “Loop((a,c),tax2(c)$(ord(c)=Ord(a))=tax1(a));” into an equation. but return an error message “Equation definition within a LOOP or IF statement not allowed”.

How should I do?


在 2012年8月27日星期一UTC+8下午4时20分40秒,Alireza Bahari写道:

Hi
set a /a1,a2,a3/;
set c /c1,c2,c3/;

tax1(a);
*tax1(a) has been initialized;
tax2(c);

Loop((a,c),tax2(c)$(ord(c)=Ord(a))=tax1(a));


On Mon, Aug 27, 2012 at 11:49 AM, Nan Yu wrote:

tax2(‘c1’)=e=tax(‘a1’);
On Aug 27, 2012 3:05 PM, “WeiLiang” wrote:

hi,

i’d like to copy values from tax1(a) to tax2(c). but i got an error message “Uncontrolled set entered as constant”
how can i achieve my purpose?


set a /a1,a2,a3/;
set c /c1,c2,c3/;

tax1(a);
*tax1(a) has been initialized;
tax2(c);

tax2(c)=tax1(a);


Many thanks



\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/fsmSFWCTQx8J.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/StyyTI7-WZYJ.

To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/NCMkAlKhFFYJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Equ1(i,c,a)$(Ord(a)=Ord(c))… tax2(i,c)=e=tax1(i,a);

On Mon, Aug 27, 2012 at 7:12 PM, WeiLiang wrote:

Alireza Bahari,

Thanks! it’s works.

sorry to trouble you again. when i write a line code like below, it can not work.

Equ1(c,a)$(Ord(a)=Ord(c))… tax2(i,c)=e=tax1(i,a);

Notice: tax2(i,c) and tax1(i,a) are two-dimensional sets.

How should I write the code?

thanks!!!



在 2012年8月27日星期一UTC+8下午9时40分46秒,Alireza Bahari写道:

Hi
Equations Equ1;

Equ1(c,a)$(Ord(a)=Ord(c))… tax2(c)=e=tax1(a);

On Mon, Aug 27, 2012 at 3:21 PM, WeiLiang wrote:

Alireza Bahari,

it’s great! thanks a lot!

i got another problem. i wnat to put “Loop((a,c),tax2(c)$(ord(c)=Ord(a))=tax1(a));” into an equation. but return an error message “Equation definition within a LOOP or IF statement not allowed”.

How should I do?


在 2012年8月27日星期一UTC+8下午4时20分40秒,Alireza Bahari写道:

Hi
set a /a1,a2,a3/;
set c /c1,c2,c3/;

tax1(a);
*tax1(a) has been initialized;
tax2(c);

Loop((a,c),tax2(c)$(ord(c)=Ord(a))=tax1(a));


On Mon, Aug 27, 2012 at 11:49 AM, Nan Yu wrote:

tax2(‘c1’)=e=tax(‘a1’);
On Aug 27, 2012 3:05 PM, “WeiLiang” wrote:

hi,

i’d like to copy values from tax1(a) to tax2(c). but i got an error message “Uncontrolled set entered as constant”
how can i achieve my purpose?


set a /a1,a2,a3/;
set c /c1,c2,c3/;

tax1(a);
*tax1(a) has been initialized;
tax2(c);

tax2(c)=tax1(a);


Many thanks



\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/fsmSFWCTQx8J.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/StyyTI7-WZYJ.

To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/NCMkAlKhFFYJ.

To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Hi,

Expression like
tax2(c) = tax1(a);
won’t pass the domain checking of GAMS since c and a are different sets.

perhaps you can use a 2D set to map the two sets.

  • – begin –
    set a /a1a3/;
    set c /c1
    c3/;
    set d(a,c)
    /
    a1.c1,
    a2.c2,
    a3.c3
    /;

parameter tax1(a);
tax1(a) = 1;

parameter tax2(a,c);
tax2(d(a,c)) = tax1(a);

  • – EOF –


    Yan
    2012-08-28

WeiLiang, 2012-08-27 15:05:46
Subject:how to copy values from set to another set?

set a /a1,a2,a3/;
set c /c1,c2,c3/;

tax1(a);
*tax1(a) has been initialized;
tax2(c);

tax2(c)=tax1(a);

\

Alireza Bahari,

it’s done.

thanks a lot!

On Tuesday, August 28, 2012 1:08:17 AM UTC+8, Alireza Bahari wrote:

Equ1(i,c,a)$(Ord(a)=Ord(c))… tax2(i,c)=e=tax1(i,a);

On Mon, Aug 27, 2012 at 7:12 PM, WeiLiang wrote:

Alireza Bahari,

Thanks! it’s works.

sorry to trouble you again. when i write a line code like below, it can not work.

Equ1(c,a)$(Ord(a)=Ord(c))… tax2(i,c)=e=tax1(i,a);

Notice: tax2(i,c) and tax1(i,a) are two-dimensional sets.

How should I write the code?

thanks!!!



在 2012年8月27日星期一UTC+8下午9时40分46秒,Alireza Bahari写道:

Hi
Equations Equ1;

Equ1(c,a)$(Ord(a)=Ord(c))… tax2(c)=e=tax1(a);

On Mon, Aug 27, 2012 at 3:21 PM, WeiLiang wrote:

Alireza Bahari,

it’s great! thanks a lot!

i got another problem. i wnat to put “Loop((a,c),tax2(c)$(ord(c)=Ord(a))=tax1(a));” into an equation. but return an error message “Equation definition within a LOOP or IF statement not allowed”.

How should I do?


在 2012年8月27日星期一UTC+8下午4时20分40秒,Alireza Bahari写道:

Hi
set a /a1,a2,a3/;
set c /c1,c2,c3/;

tax1(a);
*tax1(a) has been initialized;
tax2(c);

Loop((a,c),tax2(c)$(ord(c)=Ord(a))=tax1(a));


On Mon, Aug 27, 2012 at 11:49 AM, Nan Yu wrote:

tax2(‘c1’)=e=tax(‘a1’);
On Aug 27, 2012 3:05 PM, “WeiLiang” wrote:

hi,

i’d like to copy values from tax1(a) to tax2(c). but i got an error message “Uncontrolled set entered as constant”
how can i achieve my purpose?


set a /a1,a2,a3/;
set c /c1,c2,c3/;

tax1(a);
*tax1(a) has been initialized;
tax2(c);

tax2(c)=tax1(a);


Many thanks



\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/fsmSFWCTQx8J.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/StyyTI7-WZYJ.

To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/NCMkAlKhFFYJ.

To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/TQDNGXzkFY8J.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

pratik patil,

thank you ! it’s done!


On Monday, August 27, 2012 11:53:50 PM UTC+8, pratik patil wrote:

Just include i in equation definition like
Eq(i,c,a)$(ord(c) eq ord(a))…tax(i,c) = tax (i,a)
On 27 Aug 2012 21:13, “WeiLiang” wrote:

Alireza Bahari,

Thanks! it’s works.

sorry to trouble you again. when i write a line code like below, it can not work.

Equ1(c,a)$(Ord(a)=Ord(c))… tax2(i,c)=e=tax1(i,a);

Notice: tax2(i,c) and tax1(i,a) are two-dimensional sets.

How should I write the code?

thanks!!!



在 2012年8月27日星期一UTC+8下午9时40分46秒,Alireza Bahari写道:

Hi
Equations Equ1;

Equ1(c,a)$(Ord(a)=Ord(c))… tax2(c)=e=tax1(a);

On Mon, Aug 27, 2012 at 3:21 PM, WeiLiang wrote:

Alireza Bahari,

it’s great! thanks a lot!

i got another problem. i wnat to put “Loop((a,c),tax2(c)$(ord(c)=Ord(a))=tax1(a));” into an equation. but return an error message “Equation definition within a LOOP or IF statement not allowed”.

How should I do?


在 2012年8月27日星期一UTC+8下午4时20分40秒,Alireza Bahari写道:

Hi
set a /a1,a2,a3/;
set c /c1,c2,c3/;

tax1(a);
*tax1(a) has been initialized;
tax2(c);

Loop((a,c),tax2(c)$(ord(c)=Ord(a))=tax1(a));


On Mon, Aug 27, 2012 at 11:49 AM, Nan Yu wrote:

tax2(‘c1’)=e=tax(‘a1’);
On Aug 27, 2012 3:05 PM, “WeiLiang” wrote:

hi,

i’d like to copy values from tax1(a) to tax2(c). but i got an error message “Uncontrolled set entered as constant”
how can i achieve my purpose?


set a /a1,a2,a3/;
set c /c1,c2,c3/;

tax1(a);
*tax1(a) has been initialized;
tax2(c);

tax2(c)=tax1(a);


Many thanks



\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/fsmSFWCTQx8J.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/StyyTI7-WZYJ.

To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/NCMkAlKhFFYJ.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/zjOvZ6fYaBEJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Yan,

thanks!i used Alireza’s method. it’s well done. by the way, are you Chinese?

On Tuesday, August 28, 2012 10:13:44 AM UTC+8, Ryan Ren wrote:

Hi,

Expression like
tax2(c) = tax1(a);
won’t pass the domain checking of GAMS since c and a are different sets.

perhaps you can use a 2D set to map the two sets.

  • – begin –
    set a /a1a3/;
    set c /c1
    c3/;
    set d(a,c)
    /
    a1.c1,
    a2.c2,
    a3.c3
    /;

parameter tax1(a);
tax1(a) = 1;

parameter tax2(a,c);
tax2(d(a,c)) = tax1(a);

  • – EOF –


    Yan
    2012-08-28

WeiLiang, 2012-08-27 15:05:46
Subject:how to copy values from set to another set?

set a /a1,a2,a3/;
set c /c1,c2,c3/;

tax1(a);
*tax1(a) has been initialized;
tax2(c);

tax2(c)=tax1(a);


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/4oF6tdFdNc4J.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Alireza Bahari,

thank you very much! it’s well done.


On Tuesday, August 28, 2012 1:08:17 AM UTC+8, Alireza Bahari wrote:

Equ1(i,c,a)$(Ord(a)=Ord(c))… tax2(i,c)=e=tax1(i,a);

On Mon, Aug 27, 2012 at 7:12 PM, WeiLiang wrote:

Alireza Bahari,

Thanks! it’s works.

sorry to trouble you again. when i write a line code like below, it can not work.

Equ1(c,a)$(Ord(a)=Ord(c))… tax2(i,c)=e=tax1(i,a);

Notice: tax2(i,c) and tax1(i,a) are two-dimensional sets.

How should I write the code?

thanks!!!



在 2012年8月27日星期一UTC+8下午9时40分46秒,Alireza Bahari写道:

Hi
Equations Equ1;

Equ1(c,a)$(Ord(a)=Ord(c))… tax2(c)=e=tax1(a);

On Mon, Aug 27, 2012 at 3:21 PM, WeiLiang wrote:

Alireza Bahari,

it’s great! thanks a lot!

i got another problem. i wnat to put “Loop((a,c),tax2(c)$(ord(c)=Ord(a))=tax1(a));” into an equation. but return an error message “Equation definition within a LOOP or IF statement not allowed”.

How should I do?


在 2012年8月27日星期一UTC+8下午4时20分40秒,Alireza Bahari写道:

Hi
set a /a1,a2,a3/;
set c /c1,c2,c3/;

tax1(a);
*tax1(a) has been initialized;
tax2(c);

Loop((a,c),tax2(c)$(ord(c)=Ord(a))=tax1(a));


On Mon, Aug 27, 2012 at 11:49 AM, Nan Yu wrote:

tax2(‘c1’)=e=tax(‘a1’);
On Aug 27, 2012 3:05 PM, “WeiLiang” wrote:

hi,

i’d like to copy values from tax1(a) to tax2(c). but i got an error message “Uncontrolled set entered as constant”
how can i achieve my purpose?


set a /a1,a2,a3/;
set c /c1,c2,c3/;

tax1(a);
*tax1(a) has been initialized;
tax2(c);

tax2(c)=tax1(a);


Many thanks



\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/fsmSFWCTQx8J.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/StyyTI7-WZYJ.

To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/NCMkAlKhFFYJ.

To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/ErYGe0wjcgkJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Pratik,

thanks a lot! it’s done.


On Monday, August 27, 2012 11:53:50 PM UTC+8, pratik patil wrote:

Just include i in equation definition like
Eq(i,c,a)$(ord(c) eq ord(a))…tax(i,c) = tax (i,a)
On 27 Aug 2012 21:13, “WeiLiang” wrote:

Alireza Bahari,

Thanks! it’s works.

sorry to trouble you again. when i write a line code like below, it can not work.

Equ1(c,a)$(Ord(a)=Ord(c))… tax2(i,c)=e=tax1(i,a);

Notice: tax2(i,c) and tax1(i,a) are two-dimensional sets.

How should I write the code?

thanks!!!



在 2012年8月27日星期一UTC+8下午9时40分46秒,Alireza Bahari写道:

Hi
Equations Equ1;

Equ1(c,a)$(Ord(a)=Ord(c))… tax2(c)=e=tax1(a);

On Mon, Aug 27, 2012 at 3:21 PM, WeiLiang wrote:

Alireza Bahari,

it’s great! thanks a lot!

i got another problem. i wnat to put “Loop((a,c),tax2(c)$(ord(c)=Ord(a))=tax1(a));” into an equation. but return an error message “Equation definition within a LOOP or IF statement not allowed”.

How should I do?


在 2012年8月27日星期一UTC+8下午4时20分40秒,Alireza Bahari写道:

Hi
set a /a1,a2,a3/;
set c /c1,c2,c3/;

tax1(a);
*tax1(a) has been initialized;
tax2(c);

Loop((a,c),tax2(c)$(ord(c)=Ord(a))=tax1(a));


On Mon, Aug 27, 2012 at 11:49 AM, Nan Yu wrote:

tax2(‘c1’)=e=tax(‘a1’);
On Aug 27, 2012 3:05 PM, “WeiLiang” wrote:

hi,

i’d like to copy values from tax1(a) to tax2(c). but i got an error message “Uncontrolled set entered as constant”
how can i achieve my purpose?


set a /a1,a2,a3/;
set c /c1,c2,c3/;

tax1(a);
*tax1(a) has been initialized;
tax2(c);

tax2(c)=tax1(a);


Many thanks



\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/fsmSFWCTQx8J.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/StyyTI7-WZYJ.

To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/NCMkAlKhFFYJ.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/r-rhnGLAknoJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.