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!
Small Modelling Question Topic is solved
-
- User
- Posts: 118
- Joined: 7 years ago
- Location: Rosario - Argentina
Re: Small Modelling Question
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
sets i /i1*i10/
;
alias(i,j)
eq1(i).. x(i) =E= sum(j$(ord(j) le ord(i)),y(j));
best
Re: Small Modelling Question
Thanks a lot man! I totally forgot about the $ conditionManassaldi 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