Mathematica:找到复数实部为正数的条件,Reduce 的意外/冗余输出
我需要找到复数的实部为负数的条件。我认为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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不知道为什么 Mathematica 不会一步返回您期望的结果,但以下是如何分两步获取它:
一般来说,能够以通用方式处理不等式的两个函数是
Reduce
和LogicalExpand
。 (但我在这方面的知识非常有限!)我相信(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:
Generally, the two functions that can deal with inequalities in a general way are
Reduce
andLogicalExpand
. (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 return0 < b <= a
which is necessary forSqrt[a-b]
to be real as well.用
ComplexExpand
包裹Re[...]
表达式,您将得到预期结果a > 0 && b> 0 。
Wrap the
Re[...]
expression withComplexExpand
and you'll get the expected resulta > 0 && b > 0
.