本主题的答案使用 Maple 作为计算机代数系统。特别是,所有这些都在运行于 MS-DOS NT 版本 4.0 下的 Maple V 上进行了测试。(在所有这些中,加载线性代数包的预备命令以及 Maple 对 Enter 键的响应已被省略。)其他系统也有类似的命令。
其他答案将为 Wolfram Mathematica 13.0 添加。
{{TextBox|1=
- 问题 1
使用计算机解决本章开头提出的两个问题。
- 这是静力学问题。

- 这是化学问题。

- 答案
- 命令
> A:=array( [[40,15],
[-50,25]] );
> u:=array([100,50]);
> linsolve(A,u);
得出答案
. Mathematica 答案eqns = {40 h + 15 c == 100, 25 c == 50 + 50 h};
{b, m} = CoefficientArrays[eqns, {c, h}]
LinearSolve[m, -b]
{c, h} /. Solve[eqns, {c, h}]
返回 {c,h} 的向量 {1,4}。 - 这里有一个自由变量
> A:=array( [[7,0,-7,0],
[8,1,-5,2],
[0,1,-3,0],
[0,3,-6,-1]] );
> u:=array([0,0,0,0]);
> linsolve(A,u);
提示回复
. Mathematica 代码eqns = {7 h == 7 j, 8 h + i == 5 j + 2 k, 1 i == 3 j,
3 i == 6 j + 1 k};
{b, m} = CoefficientArrays[eqns, {h, i, j, k}]
LinearSolve[m, -b]
{h, i, j, k} /. Solve[eqns, {h, i, j, k}]
返回 LinearSolve 的 {0,0,0,0} 以及最后一行的
。
}}
- 问题 2
使用计算机解决第一小节中的这些系统,或得出结论“多个解决方案”或“无解决方案”。
-
-
-
-
-
-
- Maple 答案
这些很容易输入。例如,第一个
> A:=array( [[2,2],
[1,-4]] );
> u:=array([5,0]);
> linsolve(A,u);
得到预期答案
。其他输入方式类似。
- 答案是
和
。 - 答案是
和
。 - 该系统有无穷多个解。在第一小节中,以
为参数,我们得到
和
。Maple 返回
,出于某种原因,它更喜欢
作为参数。 - 该系统没有解。当给出数组
和向量
并要求 Maplelinsolve(A,u)时,它根本没有返回结果,也就是说,它没有给出任何解。 - 解是
。 - 有很多解。Maple 给出
。
Mathematica 答案RowReduceAugmentedMatrix[matrix_] := MatrixForm[RowReduce[matrix]]
将此函数应用于 MatrixForm 中的 RowReduce 对

进行行化简,得到

。
- 问题 3
使用计算机来解决第二小节中的这些方程组。
-
-
-
-
-
-
- 答案
与上一个问题一样,输入这些方程组很容易。
- 这个方程组有无穷多个解。在第二小节中,我们给出了解集为

Maple 的响应结果是
。 - 解集只有一个元素

Maple 毫不费力地找到了它
. - 这个系统的解集是无限的

Maple 给出了
. - 存在唯一的解

Maple 给出了
. - 该系统有无数个解;在第二小节中,我们用两个参数描述了解集

Maple 也给出了
. - 解集为空,Maple 对该命令的回复没有返回解。linsolve(A,u)命令。
- 问题 4
计算机对一般
系统的解给出什么?

- 答案
响应此提示
> A:=array( [[a,c],
[b,d]] );
> u:=array([p,q]);
> linsolve(A,u);
Maple 可能思考了二十秒,然后给出了以下回复。
![{\displaystyle {\bigl [}-{\frac {-d\,p+q\,c}{-b\,c+a\,d}},{\frac {-b\,p+a\,q}{-b\,c+a\,d}}{\bigr ]}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/e6eaa4c82de4539d8b1bdc63be8de9a2cd0bf38a)
- Mathematica 解决方案
RowReduce[( {
{a, c, p},
{b, d, q}
} )] // MatrixForm
返回
,大约在 2 毫秒内。