千里马:如何用复数进行正式计算?

时间:2014-04-19 09:01:53

标签: maxima

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

无论如何都要解决这个问题?

提前致谢。

2 个答案:

答案 0 :(得分:5)

您可以声明变量complex:

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

答案 1 :(得分:0)

以下是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 */

似乎更复杂"。