solve A*x=b: A simple-to-use object-oriented method for solving linear systems and least-squares problems.
软件应用简介

What’s the best way to solve a linear system? Backslash is simple, but the factorization it computes internally can’t be reused to solve multiple systems (x=Ab then y=Ac). You might be tempted to use inv(A), as S=inv(A) ; x=S*b ; y=S*c, but’s that’s slow and inaccurate. The best solution is to use a matrix factorization (LU, CHOL, or QR) followed by forward/backsolve, but figuring out the correct method to use is not easy.
In textbooks, linear algebraic expressions often use the inverse. For example, the Schur complement is written as S=A-B*inv(D)*C. It is never meant to be used that way. S=A-B*(DC) or S=A-(B/D)*C are better, but the syntax doesn’t match the formulas in your textbook.
The solution is to use the FACTORIZE object. It overloads the backslash and mtimes operators (among others) so that solving two linear systems A*x=b and A*y=c can be done with this:
F=factorize(A) ;
x=Fb ;
y=Fc ;
An INVERSE method is provided which does not actually compute the inverse itself (unless it is explicitly requested). The statements above can be done equivalently with this:
S=inverse(A) ;
x=S*b ;
y=S*c ;
That looks like a use of INV(A), but what happens is that S is a factorized representation of the inverse of A, and multiplying S times another matrix is implemented with a forward/backsolve.
Wiith the INVERSE function, your Schur complement computation becomes S = A – B*inverse(D)*C which looks just like the equation in your book … except that it computes a factorization and then does a forward/backsolve, WITHOUT computing the inverse at all.
An extensive demo is included, as well as a simple and easy-to-read version (FACTORIZE1) with fewer features, as an example of how to create objects in MATLAB.
界面展示

结果示意

规格 价
0元试用 |
---|
0.0元人民币/月 |
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!