SymPy: Limit symbol/variable to interval

后端 未结 4 1756
生来不讨喜
生来不讨喜 2021-01-04 08:32

Using SymPy, is it possible to limit the possible values of a symbol/variable to a certain range? I now I can set some properties while defining symbols, like positive

4条回答
  •  萌比男神i
    2021-01-04 09:14

    Now you can use solveset

    In [3]: solveset(x**2 - 1, x, Interval(0.5, 3)) Out[3]: {1}

提交回复
热议问题