Sum(sum()) with optimization variable
16 views (last 30 days)
I want to write the following equation as a constraint
and x is an optimization variable.
I managed to get to following formulation
Constraint2 = sum(sum(x,3),1) <= ones(1,nRess)
Now the problem is, that I do not know how to change the running boundries of the inner sum, to the above given form (so not all the elements of the dimension 3, but only starting from l=t-pt_jr to t, and also while l>0).
pt_jr is a 2D matrix.
I tried to write it with sum(sum()) as I read about vectorization and didn't want to generate too long working times wir for loops.
Thanks ahead for any ideas.