2

我想以三角形式显示复数。例如:

z = (-4)^(1/4);

我不确定它的命令是什么,写起来很愚蠢:

替代文字

我想,命令是ExpToTrig,但解决方案不可能只是1+i(或者可以,我在滥用它?)。如何以三角形式显示复数。

编辑:

命令是ExpToTrig,它只是没有给出所有的解决方案(或者我没有找到方法)。终于解决了我编写纯函数的问题NrootZpolar[n][z]

NrootZpolar := 
 Function[x, 
  Function[y, 
       ( Abs[y] ^ (1/x) *
       ( Cos[((Arg[y] + 360° * Range[0, x - 1]) / x)] + 
       I*Sin[((Arg[y] + 360° * Range[0, x - 1]) / x)]))
  ]
 ]

并使用:

In[689]:= FullSimplify[NrootZpolar1[4][-4]]
Out[689]= {1 + I, -1 + I, -1 - I, 1 - I}

可视化:

ComplexListPlot[list_] := ListPlot[Transpose[{Re[list], Im[list]}], AxesLabel -> {Re, Im}, PlotLabel -> list, PlotMarkers -> Automatic]
Manipulate[ComplexListPlot[FullSimplify[NrootZpolar1[n][z]]], {z, -10, 10}, {n, 1, 20}]

替代文字

4

3 回答 3

3

您可以用极坐标形式 r(cos theta + i sin theta) 表示复数 z,其中 r = Abs[z] 和 theta = Arg[z]。因此,您需要的唯一 Mathematica 命令是 Abs[] 和 Arg[]。

于 2010-10-13T23:01:11.293 回答
1

Mathematically speaking, (-1)^(1/4) is an abuse on notation. There is no such a number.

What you are expressing using that abomination ( :) ) are the roots of an equation:

z^4 == 1  

In Mathematica (as in math in general) is more convenient to use radians than degrees. Expressed in radians, you may define for example

 f[z1_,n_] := Abs[z] (Cos[Arg[z]] + I Sin[Arg[z]]) /.Solve[z^n+z1 == 0, z,Complex]

or

g[z1_,n_] := Abs[z] (Exp [I Arg[z]]) /.Solve[z^n+z1 == 0, z,Complex]  

depending on your notation preference (trig or exponential ... but the last is preferred).

To get your desired expression for (-4)^(1/5) just type

g[4,5] or f[4,5]
于 2010-10-14T01:10:07.483 回答
1

如果您只需要偶尔这样做,那么您可以定义一个函数,例如

In[1]:= ComplexToPolar[z_] /; z \[Element] Complexes := Abs[z] Exp[I Arg[z]]

以便

In[2]:= z = (-4)^(1/4);
In[3]:= ComplexToPolar[z]
Out[3]= Sqrt[2] E^((I \[Pi])/4)

In[4]:= ComplexToPolar[z] == z // FullSimplify
Out[4]= True

为了扩展功能(不是你的问题的一部分),你使用

In[5]:= ComplexExpand[, TargetFunctions -> {Abs, Arg}]

最后,如果你总是想要以极坐标形式写的复数,那么就像

In[6]:= Unprotect[Complex];
In[7]:= Complex /: MakeBoxes[Complex[a_, b_], StandardForm] := 
 With[{abs = Abs[Complex[a, b]], arg = Arg[Complex[a, b]]}, 
  RowBox[{MakeBoxes[abs, StandardForm], 
    SuperscriptBox["\[ExponentialE]", 
      RowBox[{"\[ImaginaryI]", MakeBoxes[arg, StandardForm]}]]}]]

将使转换自动

In[8]:= 1 + I
Out[8]= Sqrt[2]*E^(I*(Pi/4))

请注意,这仅适用于显式复数 - 即具有FullFormof 的那些Complex[a,b]z除非您在上面使用类似的东西,否则它将在上面定义的情况下失败Simpify

于 2010-10-14T01:08:05.410 回答