Ask Your Question

Revision history [back]

You called your list of symbolic variables X, so you need X[1] and not x[1].

Also beware that the A and b of polytopes inequalities are for A x + b >= 0, not A x >= b.

You called your list of symbolic variables Having named X the list [x_0, x_1, x_2], so you need use X[1] and not x[1] to get x_1.

Or, maybe even better, call that list x rather than X.

Also beware that the A and b of polytopes inequalities are for A x + b >= 0, not A x >= b.

Finally, take advantage of Python's iteration by values and change

sol = [solve(Ineq[i][0], x[1]) for i in range(len(Ineq))]

into the lighter

sol = [solve(ieq[0], x[1]) for ieq in Ineq]