I'm wondering if it is possible to create arrays of variables with different lenghts in a loop in GEKKO.
Below is just a simple example of what I mean. Parameters in the list "lengths" define what length each GEKKO array should have:
lengths = [10,20,30]
m = GEKKO()
for i in lengths:
# something...
So from this I would like to get something like:
array1 = m.Array(m.Var,10)
array2 = m.Array(m.Var,20)
array3 = m.Array(m.Var,30)
In the real problem that I'm trying to solve there will be quite many arrays that I want to include in the optimization, and they might be different depending on the situation. So it is not a good option to manually create them every time.