Hi,
I am trying to model some custom constraints to my oemof framework using pyomo. During this, I often have the need to define a recursive constraint like this:
def big_m_rule(block: po.Block, t: po.Set):
if t > 0:
return block.peak[t] >= block.peak[t - 1] - 10000 * (1- block.binary[t])
Oemof (or rather pyomo) seems to have a problem with defining constraints like this, since it always returns an error on length mismatch (“Expected axis has 95 elements, new values have 97 elements”). My guess was that it cannot handle functions like x(t) == x(t-1) + ...
although x(t) >= x(t-1)
works just fine. Is there a way to work around this?
Thanks in advance
Roman