首页 文章

使用MATLAB进行数值分析

提问于
浏览
0

我正在阅读如何使用MATLAB来解决线性方程 .

在本章中,我们讨论了几个求解方程组的数值方案

a11x1 + a12x2 + ·· ·+a1NxN = b1
a21x1 + a22x2 + ·· ·+a2NxN = b2
. . . . . . . . . = .
aM1x1 + aM2x2 + ·· ·+aMNxN = bM

可以使用矩阵向量表示法以紧凑的形式编写

A   X = b
 mxn

哪里:

a11 a12 · · a1N
AM×N = a21 a22 · · a2N
        · · · · ·
       M1 aM2 · · aMN

       x1
  x=   x2
       ·
       xN

       b1
  b =  b2
        ·
       bM

In which we have 3 cases : M=N;M<N;M>N

我无法理解下面的块:

The Nonsingular Case (M = N)

x = A^−1 b

so long as the matrix A is not singular

>>A = [1 2;2 4]; b = [-1;-1];
>>x = A^-1*b
Warning: Matrix is singular to working precision.
x = -Inf
-Inf

This is the case where some or all of the rows of the coefficient matrix A are
dependent on other rows and so the rank of A is deficient, which implies that
there are some equations equivalent to or inconsistent with other equations. If
we remove the dependent rows until all the (remaining) rows are independent of
each other so that A has full rank (equal to M), it leads to the case of M <N,
which will be dealt with in the next section.

“A的等级是否有缺陷”意味着什么呢?

2 回答

  • 2

    您获得的错误意味着 A 无法反转 . 但这并不意味着没有解决方案 . 你现在不需要停下来 .

    如果有一个解决方案,它不是唯一的 - 您可能需要找到它所在的子空间 .

    关键字是pseudoinverse . 在matlab中命令 pinv . 您将获得最接近您的问题的解决方案 .

    例如:

    c=pinv(A)*b
    

    它将为 A = [1 2;2 4]; b = [-1;-2]; 产生一个正确的解决方案(其中之一)(记住A仍然不可逆!) - 并为您的问题 b=[-1;-1] 关闭一个

  • 1

    如果矩阵行彼此线性相关,则该矩阵的行列式总是等于零 . 这里,在矩阵A中,行是(1 2)和(2 4),它们是线性相关的,即a(1 2)b(2 4)= 0,其中a = 2且b = -1 . 对于任何nXn非奇异矩阵,rank = n . 对于奇异矩阵,去除线性相关的行,然后计算行列式 . 如果不等于零,则秩= n-1 . 但是如果它再次等于零,则去除线性相关的行,现在计算行列式 . 在这种情况下,等级= n-2 .

    继续该过程直到行列式收敛到零

相关问题