Iterative Solvers in MATLAB

조회 수: 13 (최근 30일)
Sanket
Sanket 2011년 5월 31일
댓글: Pranav Gupta 2020년 5월 22일
Hello Experts,
I am trying to Solve Ax=B in MATLAB, where A is square matrix of size ~500,000 and B is the vector of same size. I have solved similar equations in COMSOL with iterative solvers like Conjugate Gradient and Algebraic Multigrid Preconditioners.
I have tried many iterative solvers like cgs, bicgs, bicgstab, minres without any preconditioners in MATLAB. But none of them would converge (1e-6). I did not try any preconditioners because I never understood the way to include them in my solver.
Does anyone know how could I implement CG with Algebraic Multigrid Preconditioner in MATLAB? Any other inputs are also welcomed :)
Sanket
  댓글 수: 1
Pranav Gupta
Pranav Gupta 2020년 5월 22일
Hello Sanket,
It has been a while, but I am curious about your success with the AMG preconditioner. I have sparse non-Hermitian (complex symmetric) matrices (100000x100000) with density ~0.5% and ILU preconditioners, etc. are not working. I was wondering if you have suggestions for me, because AMG needs a Hermitian matrix, which I don't have.

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

답변 (2개)

Laura Proctor
Laura Proctor 2011년 5월 31일
Try the pcg function in MATLAB.
From the documentation:
The five-point finite difference approximation to Laplace's equation on a square, two-dimensional domain provides an example. The following statements use the preconditioned conjugate gradient method preconditioner M = R'*R, where R is the incomplete Cholesky factor of A.
A = delsq(numgrid('S',50));
b = ones(size(A,1),1);
tol = 1.e-3;
maxit = 10;
R = cholinc(A,tol);
[x,flag,err,iter,res] = pcg(A,b,tol,maxit,R',R);
Only four iterations are required to achieve the prescribed accuracy.
  댓글 수: 1
Sanket
Sanket 2011년 5월 31일
Matlab is running the cholinc command for now. I will get back to you after it is executed

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


Sanket
Sanket 2011년 6월 1일
I used the following command, [matlab_solution,flag,relres,iter,res]=pcg(stiffness,rhs,[],200000,R',R);
After 1669 iterations, the solver stopped giving flag 3 with relres=14.0242.
The solution obtained is way incorrect. Do you know what could solve it?
One of the conditions in pcg is square matrix must be symmetric and positive definite. How would I verify that?
Also, I tried cond and condest function but I get out of memory errors.
Sanket

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by