How to solve Ax=b with matlab where A is a large unsymmetric sparse matrix? -
i'm doing ax = b
large (over 1m*1m size), non-symmetrical sparse matrix in matlab
. build a
in sparse way. however, using a\b
directly slow. tried gmres
. however, without pre-conditioner cannot right answer , pre-conditioner (ilu
instance) it's slow.
how can solve problem efficiently? thx.
it's difficult give definitive answer, since depends on particulars of system solving. unfortunately involves lot of trial , error on side , there no guaranteed method work system. here few things consider:
- how sparse system , how slow
too slow
? 1m x 1m large system, work depends on number of non-zeros; if system has many nonzeros, yes, take while run; aspect lead long running time poor numerical conditioning of system (see 1 , 2); preconditioning should this, long use effective preconditioner - try different iterative method: example bicg method or bicgstab, should work unsymmetric systems
- try tweak ilu pre-conditioner or use different preconditioner: increasing drop tolerance result in sparser pre-conditioner may affect convergence, reduce total work per iteration (values smaller drop tolerance removed sparse matrix during factorization); tweak type of precodntiioner
ilu(0)
,crout
,ilutp
; - make sure using parallel , optimised implementations of blas libraries, such intel mkl blas or @ least open blas; should speed direct method fair bit
- finally try use different framework; other frameworks allow select directly level of fill-in of ilu preconditioner (giving more options explore, result in denser preconditioner, better convergence behaviour); other frameworks petsc support wider range of preconditioners , iterative solvers;
Comments
Post a Comment