马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
很偶然的机会让我遇到了MAXIMA并产生了学习的兴趣。可是网上有关的资料非常少,中文的就更少了。幸亏软件自带帮助手册。所以打算从此处入手,一边翻译一边学习。顺便也可以为朋友们提供一份看的过去的东西。由于自己的英文水平的浅陋,很多地方自己看的似懂非懂,还要在底下琢磨,不过会尽量忠实于原文。实在译不出的会根据自己的理解来写。
MAXIMA是一个完整的计算机代数计算系统。
MAXIMA是由William F. Schelter用COMMON LISP实现的 , 基于MIT上的Macsyma的最初版本,由能源部门发布。现在从DOE获得了派生版本的权限,并遵守GNU公共协议。
MAXIMA介绍
当键入“maxima”命令启动MAXIMA后,MAXIMA会显示版本信息和提示符。每个MAXIMA命令都以分号结尾。以“quit()”结束对话,退出系统。下面是一个简单的对话的例子:
- sonia$ maxima
- GCL (GNU Common Lisp) Version(2.3) Tue Mar 21 14:15:15 CST 2000
- Licensed under GNU Library General Public License
- Contains Enhancements by W. Schelter
- Maxima 5.4 Tue Mar 21 14:14:45 CST 2000 (enhancements by W. Schelter)
- Licensed under the GNU Public License (see file COPYING)
- (C1) factor(10!);
- 8 4 2
- (D1) 2 3 5 7
- (C2) expand((x+y)^6);
- 6 5 2 4 3 3 4 2 5 6
- (D2) y + 6 x y + 15 x y + 20 x y + 15 x y + 6 x y + x
- (C3) factor(x^6-1);
- 2 2
- (D3) (x - 1) (x + 1) (x - x + 1) (x + x + 1)
- (C4) quit();
- sonia$
复制代码
MAXIMA可以搜索信息页。使用describe命令可以显示其所带参数相关的文档。如:
- (C1) describe(factor);
- 0: DONTFACTOR :(maxima.info)Definitions for Matrices and ..
- 1: EXPANDWRT_FACTORED :Definitions for Simplification.
- 2: FACTOR :Definitions for Polynomials.
- 3: FACTORFLAG :Definitions for Polynomials.
- 4: FACTORIAL :Definitions for Number Theory.
- 5: FACTOROUT :Definitions for Polynomials.
- 6: FACTORSUM :Definitions for Polynomials.
- 7: GCFACTOR :Definitions for Polynomials.
- 8: GFACTOR :Definitions for Polynomials.
- 9: GFACTORSUM :Definitions for Polynomials.
- 10: MINFACTORIAL :Definitions for Number Theory.
- 11: NUMFACTOR :Definitions for Special Functions.
- 12: SAVEFACTORS :Definitions for Polynomials.
- 13: SCALEFACTORS :Definitions for Miscellaneous Options.
- 14: SOLVEFACTORS :Definitions for Equations.
- Enter n, all, none, or multiple choices eg 1 3 : 2 8;
- Info from file /d/linux/local/lib/maxima-5.4/info/maxima.info:
- - Function: FACTOR (EXP)
- factors the expression exp, containing any number of variables or
- functions, into factors irreducible over the integers.
- FACTOR(exp, p) factors exp over the field of integers with an
- element adjoined whose minimum polynomial is p. FACTORFLAG[FALSE]
- if FALSE suppresses the factoring of integer factors of rational
- expressions. DONTFACTOR may be set to a list of variables with
- respect to which factoring is not to occur. (It is initially
- empty). Factoring also will not take place with respect to any
- variables which are less important (using the variable ordering
- assumed for CRE form) than those on the DONTFACTOR list.
- SAVEFACTORS[FALSE] if TRUE causes the factors of an expression
- which is a product of factors to be saved by certain functions in
- order to speed up later factorizations of expressions containing
- some of the same factors. BERLEFACT[TRUE] if FALSE then the
- Kronecker factoring algorithm will be used otherwise the Berlekamp
- algorithm, which is the default, will be used. INTFACLIM[1000] is
- the largest divisor which will be tried when factoring a bignum
- integer. If set to FALSE (this is the case when the user calls
- FACTOR explicitly), or if the integer is a fixnum (i.e. fits in
- one machine word), complete factorization of the integer will be
- attempted. The user's setting of INTFACLIM is used for internal
- calls to FACTOR. Thus, INTFACLIM may be reset to prevent MACSYMA
- from taking an inordinately long time factoring large integers.
- NEWFAC[FALSE] may be set to true to use the new factoring routines.
- Do EXAMPLE(FACTOR); for examples.
- - Function: GFACTOR (EXP)
- factors the polynomial exp over the Gaussian integers (i. e.
- with SQRT(-1) = %I adjoined). This is like FACTOR(exp,A**2+1)
- where A is %I.
- (C1) GFACTOR(X**4-1);
- (D1) (X - 1) (X + 1) (X + %I) (X - %I)
- (D1) FALSE
复制代码
要想在以后的运算中使用当前的一个结果,可以把它赋值给一个变量或者通过它自动提供的标签来引用它。另外,%用来引用最近的计算结果。例如:
- C2) u:expand((x+y)^6);
- 6 5 2 4 3 3 4 2 5 6
- (D2) y + 6 x y + 15 x y + 20 x y + 15 x y + 6 x y + x
- (C3) diff(u,x);
- 5 4 2 3 3 2 4 5
- (D3) 6 y + 30 x y + 60 x y + 60 x y + 30 x y + 6 x
- (C4) factor(d3);
- 5
- (D4) 6 (y + x)
- MAXIMA 可以使用复数和数字常量。
- (C6) cos(%pi);
- (D6) - 1
- (C7) %e^(%i*%pi);
- (D7) - 1
复制代码
MAXIMA可以进行微积分运算,如:
- C8) u:expand((x+y)^6);
- 6 5 2 4 3 3 4 2 5 6
- (D8) y + 6 x y + 15 x y + 20 x y + 15 x y + 6 x y + x
- (C9) diff(%,x);
- 5 4 2 3 3 2 4 5
- (D9) 6 y + 30 x y + 60 x y + 60 x y + 30 x y + 6 x
- (C10) integrate(1/(1+x^3),x);
- 2 x - 1
- 2 ATAN(-------)
- LOG(x - x + 1) SQRT(3) LOG(x + 1)
- (D10) - --------------- + ------------- + ----------
- 6 SQRT(3) 3
复制代码
MAXIMA可以求解线形系统和三次方程。
- C11) linsolve( [ 3*x + 4*y = 7, 2*x + a*y = 13], [x,y]);
- 7 a - 52 25
- (D11) [x = --------, y = -------]
- 3 a - 8 3 a - 8
- (C12) solve( x^3 - 3*x^2 + 5*x = 15, x);
- (D12) [x = - SQRT(5) %I, x = SQRT(5) %I, x = 3]
复制代码
MAXIMA也可以求解非线形方程。注意,如果你不打算在屏幕上显示结果的话,可以使用“$”来代替命令结尾的“;”。
- C13) eq1: x^2 + 3*x*y + y^2 = 0$
- (C14) eq2: 3*x + y = 1$
- (C15) solve([eq1, eq2]);
- 3 SQRT(5) + 7 SQRT(5) + 3
- (D15) [[y = - -------------, x = -----------],
- 2 2
- 3 SQRT(5) - 7 SQRT(5) - 3
- [y = -------------, x = - -----------]]
- 2 2
复制代码
在X window系统下,MAXIMA可以生成一个或多个函数的图形:
- (C13) plot2d(sin(x)/x,[x,-20,20]);
- (YMIN -3.0 YMAX 3.0 0.29999999999999999)
- (D13) 0
- (C14) plot2d([atan(x), erf(x), tanh(x)], [x,-5,5]);
- (YMIN -3.0 YMAX 3.0 0.29999999999999999)
- (YMIN -3.0 YMAX 3.0 0.29999999999999999)
- (YMIN -3.0 YMAX 3.0 0.29999999999999999)
- (D14) 0
- (C15) plot3d(sin(sqrt(x^2+y^2))/sqrt(x^2+y^2),[x,-12,12],[y,-12,12]);
- (D15) 0
复制代码
移动光标到图形窗口的左上角,系统将弹出一个菜单以供你生成图形的PostScript文件。(默认存储在你的home目录下。)并且你还可以旋转一个3D图形。
小注:①MAXIMA有Windows版本。
②最后让我们以一个MAXIMA生成的3D图形例子来结束本节,输入以下命令并回车。
plot3d(x^2+y^2,[x,-12,12],[y,-12,12]);
转自:http://www.cnblogs.com/sirsunny/category/8680.html
[ 本帖最后由 suffer 于 2007-6-29 01:33 编辑 ] |