Ниже приведена часть кода:
Код: Выделить всё
Rmatrix[i,j] = np.real(Zmatrix[i,j]) #extracted from Z matrix
Xmatrix[i,j] = np.imag(Zmatrix[i,j])
model = ConcreteModel()
Nodes = [Node list]
model.nodes = Set(initialize = [Nodes])
model.Rmatrix = Param(model.nodes, model.nodes, initialize = Rmatrix, within=NonNegativeReals)
model.Xmatrix = Param(model.nodes, model.nodes, initialize = Xmatrix, within=ComplexNumbers)
Код: Выделить всё
ERROR: Rule failed for Param 'Rmatrix' with index 0: KeyError: "Index '0' is
not valid for indexed component 'Rmatrix'"
ERROR: Constructing component 'Rmatrix' from data=None failed:
KeyError: "Index '0' is not valid for indexed component 'Rmatrix'"
Спасибо!
Я определил параметры задачи оптимизации , на основе set.nodes, но при определении параметров возникает эта ошибка.
Подробнее здесь: https://stackoverflow.com/questions/790 ... timization