Ax = b for a lot of different b‘s

조회 수: 1 (최근 30일)
David Kusnirak
David Kusnirak 2013년 4월 18일
Hello,
I have a system of equation Ax = b, where A is very large (n = 3e5 - 8e5) and sparse coefficient matrix, b is source term and x is the solution. Of course it's not a problem to solve such a problem in MATLAB, however I have to solve Ax = b for a lot of different b‘s without any change in the coefficient matrix A. The inversion of the matrix A take so long, that it is faster to solve the problem for each new b vector separately using an iterative solver. Unfortunately it is still way too slow, so I'm looking for a way how to speed it up.
Does anybody know, how to improve the performance?
Thank you for help!

채택된 답변

Matt J
Matt J 2013년 4월 18일
편집: Matt J 2013년 4월 18일
Neither direct inversion of A, nor iterative methods are required. Just create a matrix B whose columns are the different b. Then do
X=A\B
Each column X(:,i) will be the solution for the corresponding b.
  댓글 수: 4
Matt J
Matt J 2013년 4월 19일
편집: Matt J 2013년 4월 19일
well it really helps! I have lost some control, e.g. precision, parralelization or preconditioning
Not sure why you feel you've lost precision or why you think pre-conditioning matters when you're using a non-iterative method. It's true you have no control over the parallelization, but parallelization is done for you internally by MLDIVIDE.
David Kusnirak
David Kusnirak 2013년 4월 19일
편집: David Kusnirak 2013년 4월 19일
It works just fine as I said, thanks for help. The precision is far behind my tolerance treshold I used to use with the iterative solver, and of course preconditioning is not necessary now. I just felt better to have more response about what's going on, as the mldivide is somehow just a 'blackbox' for me.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by