Hi,
I am trying to write an indexed equation which runs over set i /1*4/.
How can a write just one equation and run an index to have all the
four equations.
the equation is
-
Log( q(1)/Sum(q(i))) = alpha*P(2) + C + Log(q(1)/ q(1) + q(3))
-
Log( q(2)/Sum(q(i))) = alpha*P(2) + C + Log(q(2)/ q(2) + q(4))
-
Log( q(3)/Sum(q(i))) = alpha*P(3) + C + Log(q(3)/ q(1) + q(3))
-
Log( q(4)/Sum(q(i))) = alpha*P(4) + C + Log(q(4)/ q(2) + q(4))
I tried defining C1, and C2 as subset of I. where C1 / 1, 3/ and C2 /
2, 4/ and then defining equation 1 and 3 over C1 and 2 and 4 over C2.
Set I / 1*4/
C1(I) /1, 3/
C2(I) /2, 4/;
Alias (I, J);
Eq1(C1)…
Log( q(C1)/Sum(J, q(J))) = alpha*P(C1) + C + Log(q(C1)/ Sum(C1, q
(C1))…this gives eq 1 and 3
similarly for C2 gives eq 2 and 4
I guess this works for this case but i want to know how can i pick and
choose which variables to have and which not to have in my equation
from a set. I know (ORD) and (not sameas) can work but in a random
equation with no pattern of subscript how can we pick and choose the
subscripts to have in the equation. If some can illustriate using the
above equations I will be highly obliged.
Thanks
Ashutosh
–~–~---------~–~----~------------~-------~–~----~
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
-~----------~----~----~----~------~----~------~–~—
\
I usually do this by using the dollar control option.
The syntax is: a(i)$(ord(i)=n)
where, ‘a’ is a variable or parameter defined over set ‘i’ and ‘n’ is the element of the set ‘i’ for which you want to write your equation.
I am not sure if this is the best approach but it works!
Hope this helps,
- Yogendra.
On Mon, Jul 13, 2009 at 8:30 PM, ashu wrote:
Hi,
I am trying to write an indexed equation which runs over set i /1*4/.
How can a write just one equation and run an index to have all the
four equations.
the equation is
-
Log( q(1)/Sum(q(i))) = alpha*P(1) + C + Log(q(1)/ q(1) + q(3))
-
Log( q(2)/Sum(q(i))) = alpha*P(2) + C + Log(q(2)/ q(2) + q(4))
-
Log( q(3)/Sum(q(i))) = alpha*P(3) + C + Log(q(3)/ q(1) + q(3))
-
Log( q(4)/Sum(q(i))) = alpha*P(4) + C + Log(q(4)/ q(2) + q(4))
I tried defining C1, and C2 as subset of I. where C1 / 1, 3/ and C2 /
2, 4/ and then defining equation 1 and 3 over C1 and 2 and 4 over C2.
Set I / 1*4/
C1(I) /1, 3/
C2(I) /2, 4/;
Alias (I, J);
Eq1(C1)…
Log( q(C1)/Sum(J, q(J))) = alpha*P(C1) + C + Log(q(C1)/ Sum(C1, q
(C1))…this gives eq 1 and 3
similarly for C2 gives eq 2 and 4
I guess this works for this case but i want to know how can i pick and
choose which variables to have and which not to have in my equation
from a set. I know (ORD) and (not sameas) can work but in a random
equation with no pattern of subscript how can we pick and choose the
subscripts to have in the equation. If some can illustrate using the
above equations I will be highly obliged.
Thanks
Ashu
–~–~---------~–~----~------------~-------~–~----~
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
-~----------~----~----~----~------~----~------~–~—
Thanks Yogendra,
Just had a query, in this case it seems we will have to write multiple
equations and not a write a generic equation and run an index over it.
am i correct?..The index on the equation will keep on changing and so
i do not want to keep a fixed ‘n’. For example, i am trying to find a
way, if possible to write one equation to represent all of the above
four equations.
Thanks a lot for your help. Much appreciated.
Ashu
On Jul 14, 10:04 am, Yogendra Shastri wrote:
I usually do this by using the dollar control option.
The syntax is: a(i)$(ord(i)=n)
where, ‘a’ is a variable or parameter defined over set ‘i’ and ‘n’ is the
element of the set ‘i’ for which you want to write your equation.
I am not sure if this is the best approach but it works!
Hope this helps,
On Mon, Jul 13, 2009 at 8:30 PM, ashu wrote:
Hi,
I am trying to write an indexed equation which runs over set i /1*4/.
How can a write just one equation and run an index to have all the
four equations.
the equation is
- Log( q(1)/Sum(q(i))) = alpha*P(1) + C + Log(q(1)/ q(1) + q(3))
- Log( q(2)/Sum(q(i))) = alpha*P(2) + C + Log(q(2)/ q(2) + q(4))
- Log( q(3)/Sum(q(i))) = alpha*P(3) + C + Log(q(3)/ q(1) + q(3))
- Log( q(4)/Sum(q(i))) = alpha*P(4) + C + Log(q(4)/ q(2) + q(4))
I tried defining C1, and C2 as subset of I. where C1 / 1, 3/ and C2 /
2, 4/ and then defining equation 1 and 3 over C1 and 2 and 4 over C2.
Set I / 1*4/
C1(I) /1, 3/
C2(I) /2, 4/;
Alias (I, J);
Eq1(C1)…
Log( q(C1)/Sum(J, q(J))) = alpha*P(C1) + C + Log(q(C1)/ Sum(C1, q
(C1))…this gives eq 1 and 3
similarly for C2 gives eq 2 and 4
I guess this works for this case but i want to know how can i pick and
choose which variables to have and which not to have in my equation
from a set. I know (ORD) and (not sameas) can work but in a random
equation with no pattern of subscript how can we pick and choose the
subscripts to have in the equation. If some can illustrate using the
above equations I will be highly obliged.
Thanks
Ashu
–~–~---------~–~----~------------~-------~–~----~
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
-~----------~----~----~----~------~----~------~–~—
\
Yes. That is right.
Unfortunately, I do not know how you can write this using a single equation. I suppose it will be through the use of subsets as you have tried before.
- Yogendra.
On Tue, Jul 14, 2009 at 1:34 PM, ashu wrote:
Thanks Yogendra,
Just had a query, in this case it seems we will have to write multiple
equations and not a write a generic equation and run an index over it.
am i correct?..The index on the equation will keep on changing and so
i do not want to keep a fixed ‘n’. For example, i am trying to find a
way, if possible to write one equation to represent all of the above
four equations.
Thanks a lot for your help. Much appreciated.
Ashu
On Jul 14, 10:04 am, Yogendra Shastri wrote:
I usually do this by using the dollar control option.
The syntax is: a(i)$(ord(i)=n)
where, ‘a’ is a variable or parameter defined over set ‘i’ and ‘n’ is the
element of the set ‘i’ for which you want to write your equation.
I am not sure if this is the best approach but it works!
Hope this helps,
On Mon, Jul 13, 2009 at 8:30 PM, ashu wrote:
Hi,
I am trying to write an indexed equation which runs over set i /1*4/.
How can a write just one equation and run an index to have all the
four equations.
the equation is
- Log( q(1)/Sum(q(i))) = alpha*P(1) + C + Log(q(1)/ q(1) + q(3))
- Log( q(2)/Sum(q(i))) = alpha*P(2) + C + Log(q(2)/ q(2) + q(4))
- Log( q(3)/Sum(q(i))) = alpha*P(3) + C + Log(q(3)/ q(1) + q(3))
- Log( q(4)/Sum(q(i))) = alpha*P(4) + C + Log(q(4)/ q(2) + q(4))
I tried defining C1, and C2 as subset of I. where C1 / 1, 3/ and C2 /
2, 4/ and then defining equation 1 and 3 over C1 and 2 and 4 over C2.
Set I / 1*4/
C1(I) /1, 3/
C2(I) /2, 4/;
Alias (I, J);
Eq1(C1)…
Log( q(C1)/Sum(J, q(J))) = alpha*P(C1) + C + Log(q(C1)/ Sum(C1, q
(C1))…this gives eq 1 and 3
similarly for C2 gives eq 2 and 4
I guess this works for this case but i want to know how can i pick and
choose which variables to have and which not to have in my equation
from a set. I know (ORD) and (not sameas) can work but in a random
equation with no pattern of subscript how can we pick and choose the
subscripts to have in the equation. If some can illustrate using the
above equations I will be highly obliged.
Thanks
Ashu
–~–~---------~–~----~------------~-------~–~----~
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
-~----------~----~----~----~------~----~------~–~—
Thanks yogendra,
I will post on the group if i come across a solution to write a single
equation.
Thanks
Ashu
On Jul 15, 12:41 pm, Yogendra Shastri wrote:
Yes. That is right.
Unfortunately, I do not know how you can write this using a single equation.
I suppose it will be through the use of subsets as you have tried before.
On Tue, Jul 14, 2009 at 1:34 PM, ashu wrote:
Thanks Yogendra,
Just had a query, in this case it seems we will have to write multiple
equations and not a write a generic equation and run an index over it.
am i correct?..The index on the equation will keep on changing and so
i do not want to keep a fixed ‘n’. For example, i am trying to find a
way, if possible to write one equation to represent all of the above
four equations.
Thanks a lot for your help. Much appreciated.
Ashu
On Jul 14, 10:04 am, Yogendra Shastri wrote:
I usually do this by using the dollar control option.
The syntax is: a(i)$(ord(i)=n)
where, ‘a’ is a variable or parameter defined over set ‘i’ and ‘n’ is the
element of the set ‘i’ for which you want to write your equation.
I am not sure if this is the best approach but it works!
Hope this helps,
On Mon, Jul 13, 2009 at 8:30 PM, ashu wrote:
Hi,
I am trying to write an indexed equation which runs over set i /1*4/.
How can a write just one equation and run an index to have all the
four equations.
the equation is
- Log( q(1)/Sum(q(i))) = alpha*P(1) + C + Log(q(1)/ q(1) + q(3))
- Log( q(2)/Sum(q(i))) = alpha*P(2) + C + Log(q(2)/ q(2) + q(4))
- Log( q(3)/Sum(q(i))) = alpha*P(3) + C + Log(q(3)/ q(1) + q(3))
- Log( q(4)/Sum(q(i))) = alpha*P(4) + C + Log(q(4)/ q(2) + q(4))
I tried defining C1, and C2 as subset of I. where C1 / 1, 3/ and C2 /
2, 4/ and then defining equation 1 and 3 over C1 and 2 and 4 over C2.
Set I / 1*4/
C1(I) /1, 3/
C2(I) /2, 4/;
Alias (I, J);
Eq1(C1)…
Log( q(C1)/Sum(J, q(J))) = alpha*P(C1) + C + Log(q(C1)/ Sum(C1, q
(C1))…this gives eq 1 and 3
similarly for C2 gives eq 2 and 4
I guess this works for this case but i want to know how can i pick and
choose which variables to have and which not to have in my equation
from a set. I know (ORD) and (not sameas) can work but in a random
equation with no pattern of subscript how can we pick and choose the
subscripts to have in the equation. If some can illustrate using the
above equations I will be highly obliged.
Thanks
Ashu
–~–~---------~–~----~------------~-------~–~----~
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
-~----------~----~----~----~------~----~------~–~—
\