Sympy“不等”方程

发布于 2025-02-12 19:03:23 字数 117 浏览 2 评论 0原文

有什么方法可以解决包含≠的代数方程式?

例如:2-x≠3

因此,看起来像这样:

print(solve(not_equal(2-x, 3)))

Is there any way to solve algebra equations that contain ≠?

for example: 2-x ≠ 3

So, may be it looks like this:

print(solve(not_equal(2-x, 3)))

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

烟凡古楼 2025-02-19 19:03:23

您可以使用不等式类来表示“不相等”或其别名ne。例如:

print(solve(Ne(2-x, 3)))
# out: (x > -oo) & (x < oo) & Ne(x, -1)

You can use the Unequality class to represent the "not equal", or its alias Ne. For example:

print(solve(Ne(2-x, 3)))
# out: (x > -oo) & (x < oo) & Ne(x, -1)
堇色安年 2025-02-19 19:03:23

您应该求解==等式,并在真实中对解决方案进行补充。

您也可以尝试解决Intequation&lt; and&gt;并进行解决方案集合。

You should solve the == equation and take complement of the solution in the reals.

You can also try to solve inequation < and > and take the union of the solution sets.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文