Small Modelling Question Topic is solved

Problems with modeling
Post Reply
MrBoltu
User
User
Posts: 2
Joined: 2 years ago

Small Modelling Question

Post by MrBoltu »

Hey guys I am struggling with one equation right now, that I need for my bachelor thesis.

Let's say I want to need the following equations

X_1 = y_1
X_2 = y_1+y_2
X_3 = y_1+y_2+y_3
...

How do I model this? I tried:
Equation(i).. X(i) =E= sum( i, y(i))
but this is apparently wrong because the set (of the sum) is under control already.
I also tried
Alias(i,j)
Equation(i).. X(i) =E= sum( (i =G= j) , y(i))
but that doesn't work either.
Any suggestions would be much appreciated!

Thank you in advance!
Manassaldi
User
User
Posts: 118
Joined: 7 years ago
Location: Rosario - Argentina

Re: Small Modelling Question

Post by Manassaldi »

hi, try with this sets definition

sets i /i1*i10/
;
alias(i,j)


eq1(i).. x(i) =E= sum(j$(ord(j) le ord(i)),y(j));

best
MrBoltu
User
User
Posts: 2
Joined: 2 years ago

Re: Small Modelling Question

Post by MrBoltu »

Manassaldi wrote: 2 years ago hi, try with this sets definition

sets i /i1*i10/
;
alias(i,j)


eq1(i).. x(i) =E= sum(j$(ord(j) le ord(i)),y(j));

best
Thanks a lot man! I totally forgot about the $ condition
Post Reply