Mathematica、Arg 和简化
我在使用 Mathematica 处理复数时遇到问题。我做错了什么吗?
两个例子:
ComplexExpand[(x + I y)^(1/2)] 产量 (x^2 + y^2)^(1/4) Cos[1/2 Arg[x + I y]] + I (x^2 + y^2)^(1 /4) Sin[1/2 Arg[x + I y]]
到目前为止我还没有找到办法 更简单的结果(确实存在!)
ComplexExpand[Sqrt[x^2 + y^2] Cos[Arg[x + I y]] + I Sqrt[x^2 + y ^2] Sin[Arg[x + I y]]]
产生与 ComplexExpand 参数相同的结果,但显然应该是 x + I y!
提前致谢!
I've got problems in using Mathematica with complex numbers. Am I doing something wrong?
Two examples:
ComplexExpand[(x + I y)^(1/2)]
yields (x^2 + y^2)^(1/4) Cos[1/2 Arg[x + I y]] + I (x^2 + y^2)^(1/4)
Sin[1/2 Arg[x + I y]]and I've found no way so far to get
a simpler result (which does exist!)ComplexExpand[Sqrt[x^2 + y^2] Cos[Arg[x + I y]] + I Sqrt[x^2 + y^2] Sin[Arg[x + I y]]]
yields the same result of the argument of ComplexExpand, while it should obviously be x + I y !
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于第二个,请记住 Mathematica 无法对您的符号做出假设,因此默认情况下“数字”是复数。
这就是为什么当你输入:
你会得到
或者如果你输入
你会得到
Just 因为 Mathematica 不知道 X 和 Y 是 REALS。
但您可以显式声明它,因此 Mathematica 可以将它们视为实数。
试试这个:
你会得到
记住,重置你的 $Asductions 只需要
但一般来说,不要指望 Mathematica 会按照你想要的方式呈现复数......
For the second one, remember that Mathematica can't make assumptions on your symbols, so a "number" is complex by default.
That's the reason why when you enter:
you get
or if you enter
you get
Just because Mathematica doesn't know that X and Y are REALS.
But you can explicitly declare it, so Mathematica is allowed to treat them as reals numbers.
Try this:
and you'll get
Remember that resetting your $Assumptions only needs
But in general, don't expect Mathematica will render complex numbers the way you want them...