I'm trying to complete a year-long battery optimization problem (8760 hours). "ind_1" and "ind_2" are lists of length 8760 containing 0s/1s. Certain hours of the year may earn additional revenue, so these indicator lists are used to distinguish those hours (further used in the maximization function).
m = Gekko(remote=False)
#variables
e_battery = m.Var(lb=0, ub=4000, value=2000) #energy in battery at time t, battery size 4 MWh, initial value is 2MWh
command = m.Var(lb=-1000, ub=1000) #command power -1 to 1 (in MW)
e_price = m.Param(value = price) #price is a list of 8760 values
ind_1 = m.Param(value = ind_1)
ind_2 = m.Param(value = ind_2)
m.time = np.linspace(0,8759, 8760)
m.Equation(e_battery.dt() == e_battery + command)
m.Maximize((-command)*(e_price + ind_1*ind1_price + ind_2*ind2_price))
m.options.IMODE = 6
m.solve()
When I run the above model, it runs for about 20 iteration then returns the error: "@error: Solution Not Found". The objective of this task is to return an array of 8760 values (the command variable) which maximizes the return. Any ideas where this error comes from?