计算机代数系统(Computer Algebra System, 简称 CAS),计算机代数(Computer Algebra)在很多时候又被广义地理解为“符号计算”(Symbolic Computation), 成为与所谓“数值计算”(Numerical Computation)相对的概念。“符号”的运算在这里代替了“数”的运算。符号可以代表整数, 有理数, 实数和复数, 也可以代表多项式, 函数, 还可以代表数学结构如集合, 群, 环, 代数等等。我们在学习和研究中用笔和纸进行的数学运算多为符号运算。
代数功能
计算机代数系统能计算代数式,与传统的数值运算不同的是,计算机代数系统把一个字符串(比如
)视作一个“符号”而不是一个“值”。对于计算机来说,下列的算式都属于代数运算的范畴,都需要计算机代数系统才能计算:
代数式的化简
最简单的计算机代数系统示例就是代数式的化简,好比是数值运算里的
。
![a+a = 2 a](/index.php?title=Special:MathShowImage&hash=a651f68a7a6e6bdb8359c19c3763580e&mode=mathml)
![\sqrt{x^2} = \left\vert x \right\vert](/index.php?title=Special:MathShowImage&hash=0fb3480903c44b0aacd93f3f0c29e9ef&mode=mathml)
代数式的微积分、极限、三角函数、指数函数
![\int_{}^{} \sin(\ln(x))\,dx = \frac{x\sin(\ln(x))}{2} - \frac{x\cos(\ln(x))}{2}](/index.php?title=Special:MathShowImage&hash=11292cc00fc441353aedc74f808866c5&mode=mathml)
![{\operatorname{d}\!y\over\operatorname{d}\!x} x^x = x^x (\ln(x)+1)](/index.php?title=Special:MathShowImage&hash=f7c2529d6962643e890003b27fbcd706&mode=mathml)
![\lim_{x \to 0} \frac{x}{\sin(x)} = 1](/index.php?title=Special:MathShowImage&hash=9b5c87544b0b8f7dd27116e8fe239c3b&mode=mathml)
![\int_{-\infty}^{+\infty} \frac{1-\cos(x)}{x^2}\,dx = \pi](/index.php?title=Special:MathShowImage&hash=3287f1a61662035d57ebf75a187717f2&mode=mathml)
代数式的求和与求积
![\sum_{k=1}^n \frac{1}{k(k+1)} = - \frac{1}{n}](/index.php?title=Special:MathShowImage&hash=7549749b2e5ac263157265ffb9061d51&mode=mathml)
多项式的因式分解和展开
![factor(x^5-15x^4+85x^3-225x^2+274x-120) = (x-1)(x-2)(x-3)(x-4)(x-5)](/index.php?title=Special:MathShowImage&hash=437c62814ff1cabd6498f48a007077b3&mode=mathml)
![expand((x+1)(x+2)(x+3)(x+4)(x+5)) = x^5+15x^4+85x^3+225x^2+274x+120](/index.php?title=Special:MathShowImage&hash=60a39f28a27e20619d34cce4a324f5d3&mode=mathml)
使用特征方程法求解数列通项公式
![rSolve(a_{n+2} = a_{n+1} + a_n, a_n, [a_1 = 1, a_2 =1]) = \frac{\sqrt{5}}{5}(\frac{1+\sqrt{5}}{2})^n - \frac{\sqrt{5}}{5}(\frac{1-\sqrt{5}}{2})^n](/index.php?title=Special:MathShowImage&hash=73daca99fa7dcb3e8f5ffeb02a21765a&mode=mathml)
矩阵的超越函数
![\sqrt{\begin{pmatrix}1 & 4 \\6 & 3\end{pmatrix}}=\begin{pmatrix}\frac{2\sqrt{7} + 3\sqrt{3}i}{5} & \frac{2\sqrt{7} - 2\sqrt{3}i}{5}\\ \frac{3\sqrt{7} - 3\sqrt{3}i}{5} & \frac{3\sqrt{7} + 2\sqrt{3}i}{5}\end{pmatrix}](/index.php?title=Special:MathShowImage&hash=abce65a4b59551c39277dfe51fd81264&mode=mathml)
其他功能
有些算式看起来属于数值运算的范畴,但是它们也需要计算机代数系统才能计算,或者才能得到正确结果。
高精度求值
有时所需要的精度已经远远超出了二进制直接处理所能容纳的精度,必须把数值作为“符号”看待时,也属于计算机代数系统的范畴
![2^{2^{8}} = 115792089237316195423570985008687907853269984665640564039457584007913129639936](/index.php?title=Special:MathShowImage&hash=6c62f439307ff2b148dab361d99247b0&mode=mathml)
精确数值运算
有时候需要把一些类似于
、
的常数代入算式中求值,并将其视作一个特殊的“符号”而不是它的值,或者希望输出时可以获取带有这些常数的结果,如
时,也属于计算机代数系统的范畴。
![\sin(2 \pi) = 0](/index.php?title=Special:MathShowImage&hash=75e525c13a1e0782acc51ad2e29405f0&mode=mathml)
![\sin^{-1}(1) = \frac{\pi}{2}](/index.php?title=Special:MathShowImage&hash=7c0707049d79949ae57ab6b09498294c&mode=mathml)
需要注意的是,很多函数计算器,比如 CASIO fx-82CN X,CASIO fx-82ES,TI-36X等,都支持像上面这样计算算式,但是计算的实质是近似看待,不属于计算机代数系统的范畴。例如,这些计算器在计算的时候,只能显示带一重根号或带有
的结果,而不能显示带多重根号的结果:
![\sin(\frac{\pi}{4}) = \frac{\sqrt{2}}{2}](/index.php?title=Special:MathShowImage&hash=55d2784929ceb24697f218ad08ae32d6&mode=mathml)
![\sin^{-1}(\frac{\sqrt{2 - \sqrt{2}}}{2}) = \frac{1}{8}\pi](/index.php?title=Special:MathShowImage&hash=b4bea5634a2364a4375a915f0aa4d618&mode=mathml)
![\sin(\frac{\pi}{8}) = 0.3826834324](/index.php?title=Special:MathShowImage&hash=1efbffbd74d5b9d22cb30c1d93662778&mode=mathml)
另一个表现就是对于某些十分近似的式子可能会产生错误的结果:[1]
例如,在 CASIO 的 ES 或者 ClassWiz 系列函数机中,计算下面这个式子,会得到一个含有
的答案:
![9^{6^{6^{6^{-3}}}} = \frac{346502623}{1680} \pi](/index.php?title=Special:MathShowImage&hash=6cf542b1b6d31db7980b7609c05dfcab&mode=mathml)
然而这个答案是错误的,或者说是不精确的,经过计算可得:
![9^{6^{6^{6^{-3}}}} - \frac{346502623}{1680} \pi \approx 5.21540641785 \times 10^{-8}](/index.php?title=Special:MathShowImage&hash=417be7a0811763d86dba55d7e67c7f4a&mode=mathml)
大数求和求积
如果数值求和求积并不会以传统方式进行循环,而是先计算代数结果再代入计算以提高速度,这也属于计算机代数系统的范畴,例如,在TI-Nspire CAS计算器中,默认设置的情况下:
这个式子将会被视作数值运算并以数值运算方式进行:
![\sum_{x=1}^{10000} x = 50005000](/index.php?title=Special:MathShowImage&hash=25e38779f6da62c673943f19aaebdfb1&mode=mathml)
这个式子将会被视作代数运算并使用计算机代数系统:
![\sum_{x=1}^{100000000} x = 5000000050000000](/index.php?title=Special:MathShowImage&hash=274fa4038fe754280c57c526414e33d4&mode=mathml)
拥有计算机代数系统的计算器
请勿大量罗列
此处仅列举同类事物的典型事例。您可以继续添加,但是添加的事例必须具有代表性。
此处仅列举自带计算机代数系统的计算器,通过安装插件(如 CASIO fx-CG20 可以通过安装 Eigenmath 来实现计算机代数系统)或者某些程序(如 不带CAS功能的黑白屏 TI-84 Plus 安装 Zoom500[2] 来实现计算机代数系统)则不会被列入此列表中。
卡西欧
德州仪器
惠普
请参考分类:拥有计算机代数系统的计算器以获取更多相关信息。
支持计算机代数系统的计算软件
开源软件
商业软件
参考