【问题标题】:Maxima : how to do formal calculations with complex numbers?Maxima:如何用复数进行形式计算?
【发布时间】:2014-04-19 09:01:52
【问题描述】:

我是 Maxima 的新手,我在文档中找不到如何对复数进行正式计算。当我使用未指定的变量时,Maxima 似乎假设它们是真实的: 例如 conjugate(x) 返回 x。

有没有办法解决这个问题?

提前致谢。

【问题讨论】:

    标签: complex-numbers maxima


    【解决方案1】:

    你可以声明一个复杂的变量:

    (%i1) declare(x, complex) $
    (%i2) conjugate(x);
    (%o2)                            conjugate(x)
    (%i3) conjugate(realpart(x));
    (%o3)                             realpart(x)
    

    【讨论】:

      【解决方案2】:

      以下是 to_poly 包的一些测试:

      (%i1) load(to_poly);
      (%o1)  home/a/maxima/share/to_poly_solve/to_poly.lisp
      (%i2) r;
      (%o2) r 
      (%i3) isreal_p(r);
      (%o3) true     /*  When I use unspecified variables, Maxima seems to assume that they are real */ 
      (%i4) z:x+y*%i;
      (%o4) %i y + x
      (%i5) isreal_p(z);
      (%o5) isreal_p(%i y) /* maxima can't check if it is real or not */
      (%i6) isreal_p(x);
      (%o6) true
      (%i7) isreal_p(y);
      (%o7) true
      (%i8) complex_number_p(z); 
      (%o8) false 
      (%i9) declare(z, complex);
      (%o9) done
      (%i10) complex_number_p(z);
      (%o10)   false /* still not complex */
      

      这似乎更“复杂”。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-07-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多