如何知道Complex的结果具有一个或多个真实根 [英] How to know the result of Complex has one or more real roots

查看:106
本文介绍了如何知道Complex的结果具有一个或多个真实根的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Complex来计算负功率.

I want to use Complex to calculate the minus pow.

使用Math.Pow的$(-10)^(1/3)$会得到NAN.

As $(-10)^(1/3)$ that use the Math.Pow will get the NAN.

但是当我使用Complex.Pow时,我可以获得结果.

But when I use Complex.Pow, I can get the result.

        Complex c = Complex.Pow(-10, 1.0/3);
        var r = c.Magnitude;//2.1544346900318843

但是实际结果是-2.1544346900318843.

But the real result is -2.1544346900318843.

我不知道结果是肯定的,因为幅度是绝对值.

I don't know the result is positive for the Magnitude is Abs.

我不能在所有结果中加上-1*,因为战俘可以使结果是肯定的.

I can't add -1* in all the result for the pow can make the result is positive.

(-10)^(2/3)应该得到肯定的结果.

(-10)^(2/3) should get the positive result.

请参阅: https://stackoverflow.com/a/43539898/6116637

-

编辑

(-10)^(2/3)

(-10)^(2/3)

    Imaginary   4.0197338438308483  double
    Magnitude   4.6415888336127784  double
    Phase   2.0943951023931953  double
    Real    -2.3207944168063883 double

(-10)^(1/3)

(-10)^(1/3)

    Imaginary   1.8657951723620641  double
    Magnitude   2.1544346900318843  double
    Phase   1.0471975511965976  double
    Real    1.0772173450159421  double

如何计算它,请参见: https://en.wikipedia.org/wiki/De_Moivre%27s_formula

How to calculate it,see:https://en.wikipedia.org/wiki/De_Moivre%27s_formula

推荐答案

在复数中,任何数字都有三个立方根.
对于负数(负实部,无虚部),三个根的排列如下.

In complex numbers there are three cubical roots for any number.
For negative numbers (negative real part, no imaginary part), the three roots are arranged like this.

                                       X1  
                                      /  
                                     /  
                                    /  
                                   /
                    X2------------0  
                                   \  
                                    \  
                                     \  
                                      \  
                                       X3  

它们都具有相同的大小,实际上是与(0,0)== 0 + i0的距离.
X1和X3具有相同的实部,是X2实部的一半.
X1和X3具有相同的虚部绝对值,但符号不同.
X2没有虚部. X2的实数部分为负值.

They all have the same magnitude, which is practically the distance from (0,0)==0+i0.
X1 and X3 have the same real part, which is half of the real part of X2.
X1 and X3 have the same absolute value of the imaginary part, with different sign.
X2 has no imaginary part. The real part of X2 is minus the magnitude.

因此,X2的负部分不是幅度.
根据定义,幅度对于所有根都是正的.

So, the real part of X2, which is negative, is not the magnitude.
The magnitude, by definition, is positive for all of the roots.

请注意,三个根的平方也不一定具有正实部.
尤其是第一个根(X1)的平方,在数学上为正方向的第一个,从正实轴开始.
没有虚部的复数的平方是正的,没有虚部,但是对于虚数不为零的复数则不是这样.

Note that the square of the three roots do not necessarily have positive real parts either.
Especially the square of the first root (X1), being the first in mathematical positive direction, starting at positive real axis.
The square of the complex numbers without imaginary part is positive and has no imaginary part, but that is not true for complex numbers with non-zero imaginary part.

                                 X1^2
                                   \  
                                    \  
                                     \  
                                      \  
                                       0------------X2^2  
                                      /  
                                     /  
                                    /  
                                   /
                                 X3^2

未为compley数字定义正"属性.它仅针对虚部和实部这两个部分中的每一个进行定义.
复数的大小始终> = 0.但是幅度不一定与复数的平方(或平方的平方根)相同. 每个复数都有两个平方根.由于它们相距180°,所以其中一个始终将具有负实部,另一个将始终具有正实部,或者两者都为零.

The attribute "positive" is not defined for compley numbers. It is only defined for each of the two parts, the imaginary part and the real part.
The magnitude of a complex number is always >=0. But the magnitude is not neccessarily identical to the square of the complex number (or the square root of the square). There are two square roots for each complex number. Since they are 180° apart, one of them will always have negative real part, the other positive real part, or both are zero.

是否存在一个或多个虚部为零且实部为正的根(这似乎是您说正"时的意思),您必须通过检查它们中的每一个来检查.您可以通过获取第一个根的所有幂1..N-1(这是X ^(1/N)的结果)来实现的.至少我不知道这样做的捷径.
请注意(作为评论使我知道),计算出的数字不是根,但它们具有相同的相位,因此可以进行判断.

Whether there is one or more roots with zero imaginary part and positive real part (which seems to be what you mean when saying "positive") is something you will have to check by inspecting each of them. You can do that by getting all the powers 1..N-1 of the first root (which is the result for X^(1/N)). At least I do not know a shortcut for that.
Note that (as a comment made me aware) the numbers calculated are not the roots, but they have the same phase and therefor allow judging.

这篇关于如何知道Complex的结果具有一个或多个真实根的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆