I am new to Pyomo, but trying to formulate a model, which has one set of constraints, that I stuck to define. Lets assume, I have following simple code to show what I am trying to do
m = ConcreteModel()
m.rs = Set(initialize =[rs for rs in RS])
m.a = Set(initialize=[a for a in A])
m.t = ContinuousSet(bounds=(0, 10))
m.E = Var(m.rs, m.t)
m.tau = Var(m.a, m.t)
I know it is not correct to use a non-set component tau(t, a)
as an indexed component, this is just to show simply I need:
m.E[rs, t] == sum(m.E[rs, t + tau(t, a)] for all a in ...)
The value of tau(t, a)
are calculated within the model when solving it. Any idea, how this sort of constraint con be written?
Your help would be highly appreciated!
question from:
https://stackoverflow.com/questions/65863576/pyomo-using-a-non-set-component-as-an-indexed-set 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…