i am trying an opimization problem in pyomo...i get 'SumExpression' object is not iterable error at line(model.nt[j] = model.ntm1[j] + ....)... as shown in below code R_2_j(), R_1_j() function outputs depend on decision variables...if i make model.nt a parameter it shows because of decision variable involved t is not i real domain so i made model.nt a set now and also can i not do this ""model.ntm1[j] + model.q[j]*R_2_j(model, j, -1)"" like to multiply and add function and model...if so what should i do about it ...and also since model.nt involves decision variables should i keep model.nt a set or a param or a var
model.q = Param(model.l,
initialize={2: 0.235,
4: 0.235,
6: 0.235,
8: 0.235},
doc='q')
model.nt = Set(model.l)
model.ntm1 = Param(model.l,
initialize={2: 0,
4: 0,
6: 0,
8: 0},
doc='queuesmm1')
for j in model.l:
model.nt[j] = model.ntm1[j] + model.q[j]*R_2_j(model, j, -1) + model.q[j]*(R_1_j(model,j, 0) + G_e_j(model,j, 0)) - model.s[j]*G_e_j(model,j, 0)