Mathematica:找到复数实部为正数的条件,Reduce 的意外/冗余输出

发布于 2024-12-25 17:15:04 字数 539 浏览 1 评论 0原文

我需要找到复数的实部为负数的条件。我认为Reduce 非常适合这个,但它提供了冗余输出(即使在简化之后)。例如:

In[543]: Reduce[{Re[-1 - Sqrt[a - b] ] < 0, a > 0, b > 0}, {a, b}, Complexes]
Out[543]: a > 0 && (0 < b < a || b >= a)  

由于a和b因为出现在不等式中而被假设为实数,因此不需要对a和b之间的关系进行进一步的假设,我期望的结果是:

Out[543]: a > 0 && b > 0  

是否有一个很好的理由为什么没有得到? (在我看来)冗余结果会随着更复杂的表达式而累积,我需要减少其中相当多的结果。有什么技巧可以得到预期的结果吗?我尝试过选择 Reals 作为域并根本不选择任何域,但没有任何东西真正能给我我想要的东西。顺便说一句,我正在通过检查特征值来分析不动点的稳定性......这是一个非常常见的任务。

I need to find the conditions for the real part of a complex number to be negative. I thought Reduce would be perfect for this, but it gives redundant output (even after simplification). For example:

In[543]: Reduce[{Re[-1 - Sqrt[a - b] ] < 0, a > 0, b > 0}, {a, b}, Complexes]
Out[543]: a > 0 && (0 < b < a || b >= a)  

As a and b are assumed to be real because they appear in an inequality, there needs to be no further assumption about the relation between a and b, the result I expect is:

Out[543]: a > 0 && b > 0  

is there a good reason why that is not obtained?
The (in my eyes) redundant results accumulate for more complex expressions and I need to reduce quite a few of them. Is there a trick to get the expected result? I played around with choosing Reals as the domain and choosing no Domain at all, but nothing really gives me what I want. By the way I am analyzing the stability of fixed points by checking eigenvalues...a very common task.

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

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

发布评论

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

评论(2

风苍溪 2025-01-01 17:15:04

我不知道为什么 Mathematica 不会一步返回您期望的结果,但以下是如何分两步获取它:

Mathematica Graphics

一般来说,能够以通用方式处理不等式的两个函数是ReduceLogicalExpand。 (但我在这方面的知识非常有限!)我相信 (Full)Simplify 只会使用后一种。


关于在Reduce中设置域的评论:

请注意,文档中说:“如果 dom 是实数,或者是整数或有理数等子集,那么所有常量和函数值也被限制为实数。”因此,如果您将域指定为 Reals (如 @belisarius 的答案),Reduce 将返回 0 0 0 0 0 b <= a 这也是 Sqrt[ab] 为实数所必需的。

I don't know why Mathematica won't return the result you are expecting in one step, but here's how to obtain it in two steps:

Mathematica graphics

Generally, the two functions that can deal with inequalities in a general way are Reduce and LogicalExpand. (But my knowledge is very limited in this area!) I believe (Full)Simplify will only use the latter one.


A comment on setting domains in Reduce:

Note that the documentation says: "If dom is Reals, or a subset such as Integers or Rationals, then all constants and function values are also restricted to be real." Hence if you were to specify the domain as Reals as in @belisarius's answer, Reduce would return 0 < b <= a which is necessary for Sqrt[a-b] to be real as well.

吹梦到西洲 2025-01-01 17:15:04

ComplexExpand 包裹 Re[...] 表达式,您将得到预期结果 a > 0 && b> 0 。

Wrap the Re[...] expression with ComplexExpand and you'll get the expected result a > 0 && b > 0.

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