I recently started with Pyomo and I have the following Problem:
I want to construct a ConstraintList with an if statement. I already learned, that it's not possible. But the problem still exists... My first code (with the if statement) was the following one:
m.Constraint10=pyo.ConstraintList() for i in m.Stunde: for j in m.Kraftwerk: if pyo.value(m.Kraftwerkseinsatz[i,j]) != 0: m.Constraint10.add(m.Kraftwerkseinsatz[i,j]>=m.MinOutput[j])
m. Kraftwerk are indices.
m.Kraftwerkseinsatz is a variable!
m.MinOutput is a parameter.
In other words, my variable must be greater than the MinOutput parameter or zero (for every hour and every power plant).
I already thought of reframing the constraint like this:
m.Kraftwerkseinsatz[i,j] must not be between 0.1 and
But I don't know how to code this either. Can anyone help me?