Any ideas on how to nest summations.
What I am trying to do is the following
for each element 't' of 1 ... (T-60). I want a constraint like this
(dp[t+1]+dp[t+2]+dp[t+3]...+dp[t+60]) - Ip[t]) >=0
I'm currently modeling this constraint in AMPL as
subject to IB {t in 1..(T-60)}: sum{(t+1)..(t+60)} (dp[t]) - Ip[t] >=0;
but this doesn't appear to constraining as I expected it to.
Anyone, see a problem with my formulation. Thanks in advance for your
help.
-Richard
param T=40;
param Ip{1..(T-60)};
let {i in 1..(T-60)} Ip[i] := 40;
var dp{1..T};
subject to hej {s in 1..(T-60)}:
(sum {i in (s+1)..(s+60)} dp[i]) - Ip[s] >= 0;
maximize rum:
sum {p in 1..kert} dp[p];
solve;
display rum;
Markus
maximize rum:
sum {p in 1..T} dp[p];
But it doesn't matter because it's not your objective after all.
Regards
Markus
P.S. I often use as many round brackets as possible. But thank you.