I want to put GEKKO Parameter 'N' in Varibale 'Y', but i got an error like below one. I mean that the Parameter 'N' should be changed continuously when the optimization is going on. Is there any other way that could make a changing N?
from gekko import GEKKO
m = GEKKO()
k = 10
N = m.Param(value=[i+1 for i in range(6)])
Y = m.Array(m.Var, (N, k))
for i in range(N):
for j in range(k):
Y[i, j].value = 0
Y[i, j].lower = 0
Y[i, j].upper = 1
Traceback (most recent call last):
File "C:\Users\johnh\Desktop\test.py", line 6, in <module>
Y = m.Array(m.Var, (N, k))
File "C:\Python37\lib\site-packages\gekko\gekko.py", line 1916,
in Array x = np.ndarray(dim,dtype=object)
TypeError: 'GKParameter' object cannot be interpreted
as an integer