Hi!
I want to write this expression but I know that is no possible because I sum j and for all j. I think It would have 2 indexes like j ,j´ but I don’t know how to do it gams.
Please, Can you help me with this? I find something with alias but I dont know how to use.
GAMS:
alias(j,jb)
eq(j) .. (sum(p,is(j,p))+ sum(i,(th(j,i)*Y(i,j))) - sum(k,dm(j,k))) =G= sum(jb,(sum(p,is(jb,p))+ sum(i,(th(jb,i)*Y(i,j))) - sum(k,dm(jb,k)))))*V_NEG*(dm(j,k)/(sum(jb,dm(jb,k))));
EQUATION:
Two Indexex [Maybe Alias problem] Topic is solved
Re: Two Indexex [Maybe Alias problem]
Hi
It looks like this must be an alias for j, so just define alias(j,jj) and replace every j on the right hand side by a jj.
Cheers
Renger
It looks like this must be an alias for j, so just define alias(j,jj) and replace every j on the right hand side by a jj.
Cheers
Renger
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
Enjoy modeling even more: Read my blog on modeling at The lazy economist
Re: Two Indexex [Maybe Alias problem]
Thanks a lot Renger , but the error continues: "Uncontrolled set entered as constant"
I had change:
alias(j,jj);
eq_margen_1(j) .. (sum(p,is(j,p))+ sum(i,(th(j,i)*Y(i,j))) - sum(k,dm(j,k))) =G= (sum(jj,(sum(p,is(jj,p))+ sum(i,(th(jj,i)*Y(i,jj))) - sum(k,dm(jj,k)))))*V_NEG*(dm(jj,k)/(sum(jj,dm(jj,k))));
Thanks!
I had change:
alias(j,jj);
eq_margen_1(j) .. (sum(p,is(j,p))+ sum(i,(th(j,i)*Y(i,j))) - sum(k,dm(j,k))) =G= (sum(jj,(sum(p,is(jj,p))+ sum(i,(th(jj,i)*Y(i,jj))) - sum(k,dm(jj,k)))))*V_NEG*(dm(jj,k)/(sum(jj,dm(jj,k))));
Thanks!
-
- User
- Posts: 118
- Joined: 7 years ago
- Location: Rosario - Argentina
Re: Two Indexex [Maybe Alias problem]
Hi, the problem is in set k at the end of the equation: ...V_NEG*dm(j,k)/sum(jj,dm(jj,k));
This is the equation exactly like the one in the image:
eq_margen_1(j) .. sum(p,is(j,p))+ sum(i,th(j,i)*Y(i,j)) - sum(k,dm(j,k)) =G= sum(jj, sum(p,is(jj,p))+ sum(i,th(jj,i)*Y(i,jj)) - sum(k,dm(jj,k)))*V_NEG*dm(j,k)/sum(jj,dm(jj,k));
As you can see the set k is not under control.
Bye!
This is the equation exactly like the one in the image:
eq_margen_1(j) .. sum(p,is(j,p))+ sum(i,th(j,i)*Y(i,j)) - sum(k,dm(j,k)) =G= sum(jj, sum(p,is(jj,p))+ sum(i,th(jj,i)*Y(i,jj)) - sum(k,dm(jj,k)))*V_NEG*dm(j,k)/sum(jj,dm(jj,k));
As you can see the set k is not under control.
Bye!
Re: Two Indexex [Maybe Alias problem]
You are right, thanks a lot Manassaldi