I need to use multiple constraints in scipy for optimization:
cons = ({'type': 'eq', 'fun': cons0},\
{'type': 'eq', 'fun': cons1},{'type': 'eq', 'fun': cons2}, ....)
I try to generate it by loop but cons0 or cons1 or cons3 is considered as a string and I get errors.
cons= []
for i in range(3):
name = cons + str(i)
cons.append({'type': 'eq', 'fun': name})