Hello,
my model has the following constraint:
s(i,j)*x(j)+sum((m,t_), MW(i,j,m,t_)*y(j,m,t_))+sum((k,t_),MWK(i,j,k,t_))+dM(i,j,t)-dP(i,j,t)=B(i,t)
The index domain is: (i,j,t)
I want the system to accumulate all MWK(i,j,k,t_) respectively all MW(i,j,m,t_)*y(j,m,t_) from t_0 until t_=t and then to add this solution to s(i,j)*x(j). Because t (periods) is already in the index domain I defined a second index t_ in the period set. Unfortunately the system sums up all MWK(i,j,k,t_) over all periods and add this in every t. So if there is a MWK(1,1,1,5)=1 then the system adds this also in t=0.
Is there any possibility to determine that the sum should start at t_=0 and end in t_=t?
Thanks in advance!
Page 1 / 1
you can add condition in your sum (assuming you already have the set of t correctly ordered):
code:
s(i,j)*x(j)+sum((m,t_)|ord(t_)<= ord(t), MW(i,j,m,t_)*y(j,m,t_))+sum((k,t_),MWK(i,j,k,t_))+dM(i,j,t)-dP(i,j,t)=B(i,t)
It works!
Thanks a lot!
Thanks a lot!
Reply
Sign up
Already have an account? Login
Please use your business or academic e-mail address to register
Login to the community
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.