I want to calculate the eigenvalues form the very huge sparse mass and stiffness matrix.

4 views (last 30 days)
I have mass and stiffness matrix in sparse format since the size of the matrix is too big.
I want to claculate the eigenvalues from them in the sparse format only. How to do so?

Accepted Answer

Aquatris
Aquatris on 20 Jun 2024
Edited: Aquatris on 20 Jun 2024
If eig() function is taking too long, you can use eigs() function.
Example from mathworks eigs() site:
A = delsq(numgrid('C',15));
size(A)
ans = 1x2
139 139
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
eigs(A)' % by default 6 largest eigenvalues
ans = 1x6
7.8666 7.7324 7.6531 7.5213 7.4480 7.3517
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
eigs(A,20)' % optional argument to define how many eigenvalues you want
ans = 1x20
7.8666 7.7324 7.6531 7.5213 7.4480 7.3517 7.2848 7.1478 7.1093 7.0644 6.9295 6.8257 6.7737 6.7395 6.6472 6.5914 6.4252 6.4118 6.3598 6.3196
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
eigs(A,5,'smallestabs')' % optional argument to get the smallest eigenvalues instead
ans = 1x5
0.1334 0.2676 0.3469 0.4787 0.5520
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>

More Answers (0)

Categories

Find more on Linear Algebra in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!