I'm trying to use mystic to create a simplified expression of my constraints. I have an array of 200 elements. I'm first testing for 1 constraint, which is limiting the sum of all the variables between min and max limits like this:
0 <= x0 + x1 + x2 + ....... x198 + x199 <= 20000
The issue is this process is taking too long to simplify just for this 1 constraint alone - approx 1hr (haven't even added others yet). How can I resolve this?
min_lim = 0
max_lim = 20000
def constraint_func():
variable_num = ['x'+str(i) for i in range(200)]
constrain_eq = f'{min_lim} <=' + ' + '.join(variable_num) + f' <= {max_lim}'
return constrain_eq
eqn = ms.simplify(constraint_func(), all=True)
constrain = ms.generate_constraint(ms.generate_solvers(eqn), join=my.constraints.and_)