Frage

I have a sparse matrix in Matlab 43916x43916, which is calculated by this equation:

B=(speye(nV,nV)-alpha*NeMatrix+beta*NeMatrix*NeMatrix);

being nVa int, alphaa int, NeMatrix a sparse matrix and beta a int.

I can't do inv(B) because it increases the use of RAM till it crashes. I've tried LU already with no success.

How can I alternatively calculate this inverse matrix?

War es hilfreich?

Lösung

The inverse will be a dense matrix. Thus you should check, whether you can handle a matrix of this size. Try, e.g., to set up ones(nV,nV) ... If you have enough storage, you may consider to compute the inverse column wise. The i-th column would be B\ei, where ei is the i-th unit vector.

HOWEVER, in numerical computations you hardly ever need the inverse of a matrix B. Most times B\v is enough, where v is a vector. So you better check, whether you really need the full inverse...

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top