5

I would like to solve a multivariate optimization problem by converting it to a system of non-linear equations and solving using sympy's "solve" function as so:

xopt = sympy.solve(gradf, x, set=True)

Trouble is, this particular equation has an infinite set of solutions and calling solve just freezes my computer.

If i could set lower and upper bounds for my symbolic variables, i.e introduce a set of constraints:

l1 <= x1 <= u1, l2 <= x2 <= u2, ..., ln <= xn <= un

... i could limit the set of solutions to a finite one, but im having a hard time finding out how to do this with sympy's API. Can anyone help out ?

Community
  • 1
  • 1

0 Answers0