LinearSolve
Usage
• LinearSolve[m, b]求解矩阵方程 m.x b的 x 。
Notes
• LinearSolve 对数值和符号矩阵都可以使用。 • 自变量 b 或者是一个向量或者是一个矩阵。 • 矩阵 m 可以是方阵或矩形阵。
• 对未确定的系统,LinearSolve返回一个可能的解之一;Solve返回通解。
• 对稀疏线性方程系统,通常用Solve比用LinearSolve更有效。
• 如果需要解相同的近似数值线性系统几次,通常使用LUDecomposition比LUBackSubstitution更有效。 • LinearSolve[m, b, Modulus -> n] 取模 n的矩阵方程。 • LinearSolve[m, b, ZeroTest -> test] 计算 test[ m[[i, j]] ] 确定矩阵元素是否为零。缺省设置是 ZeroTest -> (# 0 &).
• 可以给出 Method选项。可能的设置是 CofactorExpansion, DivisionFreeRowReduction 和 OneStepRowReduction. Automatic的缺省设置在依赖于给出的矩阵的方法间切换。 • 参见 Mathematica 全书 : 节 3.7.8.
Further Examples
This is the solution of the linear system m.s v.
In[1]:=
|
In[2]:=
|
In[3]:=
|
Out[3]=
|
This checks the answer.
In[4]:=
|
Out[4]=
|
Modular systems You can solve matrix equations over the integers modulo .
In[5]:=
|
In[6]:=
|
In[7]:=
|
Out[7]=
|
This checks the result.
In[8]:=
|
Out[8]=
|
This clears the variables.
In[9]:=
|
|