I'm trying to add constraints to a mathematical model iteratively with Scipy using lambda function as below:
cons = []
for i in range(3):
a = lambda x: np.array([x[i] - 600])
cons.append({'type': 'ineq', 'fun': a})
But it executes only the last call, when i=2. How can I do to make this a full evaluation and execute all the elements in iteration? I read a couple of posts here without sucesss