matlab - Backslash for solving very big sparse matrix in Ax=b -


in code @ each time step sparse matrix a built follows:

1< dx <120000 

a = sparse(i,j,s,dx,dx,6*dx)

b = (1,dx) 

the problem dealing sort of discretization problem. have maximum 120000 nodes. each of these nodes having special charachters , choose ones meet criteria. number of these chosen ones dx , dependent on physical process.

i using backslash in x = a\b. size of a become quite big, computational time rises drastically (more 10e5 time steps having (dx > 6e4).

as far know, backslash operation optimized in matlab know:

  1. would make sense use codegen , convert code c?

  2. does 1 know alternative method instead of backslash, computational time decreases (maybe iterative method)?

while x = a\b works many systems, can run memory issues causing slowdowns. alternately, matlab has number of built in functions iteratively solving ax=b sparse matrices, such pcq(), bigcg(), cgs(), etc. see matlab documentation on interative methods solving systems of linear equations


Comments