Finding inv(A) for Ax=b system

1 回表示 (過去 30 日間)
Asif Arshid
Asif Arshid 2017 年 7 月 27 日
コメント済み: M.Shaarawy 2019 年 5 月 20 日
I tried 3 methods to solve the system for inv(A), where A is highly sparse matrix spy(A) is given below:
1) pinv(A)......... Matlab solve it in 190 sec without any warnings.
2) A\b............. Matlab took only 10 sec but gives warning "Matrix is singular to working precision"
3) [L,U]=lu(A); inv(L)*inv(U) .......... Matlab took 50 sec but give the same warning as in 2nd method.
Is there anyway, I can get inv(A) without warnings.
  3 件のコメント
Jan
Jan 2017 年 7 月 27 日
編集済み: Jan 2017 年 7 月 27 日
@Asif Arshid: What is your question? You observed that the slash operator has a different sensitivity to detect near to singular matrices than lu and inv(L)*inv(U). What is the condition number of the matrix? Do you think that slash is to pessimistic or the lu method too sloppy? Or are you surprised by the speed of the slash operator?
Asif Arshid
Asif Arshid 2017 年 7 月 27 日
@Stephen: I tried "mldivide", but its gives warning of "Matrix is singular to working precision".
@Jan: my question is, I need to solve my system for "x" in less time than "pinv" (190 sec). The condition number is 4.7167e+17.

サインインしてコメントする。

回答 (1 件)

Star Strider
Star Strider 2017 年 7 月 27 日
Use the lsqr (link) or similar function to solve sparse matrix problems.
  4 件のコメント
Star Strider
Star Strider 2017 年 7 月 27 日
@Walter — Thank you.
M.Shaarawy
M.Shaarawy 2019 年 5 月 20 日
Is there regularized parameterized trust region sub problem (RPTRS) in MATLAB to solve this kind of problem?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSparse Matrices についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by