Finding all eigen value between two given eigen value.

Suppose there are two square symmetric matrices [K] and [M]. Since my work is related with structural analysis so they are typically stiffness and mass matrices. I am doing wave propagation study for a narrow band input load. In frequency domain, load amplitude is significant only between frequency [omega1 omega2]. So I am interested to find all eigen value and corresponding eigen vector only in this range.
The eigen value problem statement is
[K]=lambda[M]

Risposte (2)

Since you know both omega1 and omega2, and know that K is symmetric and M is symmetric positive definite (meaning the eigenvalues are all real), I would suggest setting sigma to be (omega1+omega2)/2. The eigenvalues closest to sigma will be returned first.
Unfortunately, you still have to make a guess about how many eigenvalues are in this interval, and increase / decrease k based on whether the found eigenvalues have already filled the whole interval.
You can avoid some re-computation here by setting the function handle input for the decomposition of K that is needed for this case:
dK = decomposition(K-sigma*M); % Factorize K - sigma*M, which is used internally for the case below
fcn = @(x) dK\x;
[V, D] = eigs(fcn, size(K, 1), M, k, sigma);
% Check if D contains enough eigenvalues to fill the interval. If not, call eigs again with a larger k.
Keep in mind, the function handle fcn passed to eigs must match the mode of computation, so if you change the inputs to eigs you may need to adjust fcn, too.
Edited to fix an issue pointed out by Torsten.

2 Commenti

I think you mean
[V, D] = eigs(fcn, size(K, 1), M, k, sigma)
instead of
[V, D] = eigs(dK, size(K, 1), M, k, sigma)
Good catch, I will fix it above.

Accedi per commentare.

Torsten
Torsten circa 12 ore fa
Modificato: Torsten circa 11 ore fa
There is no special feature in "eig" or "eigs" to find all eigenvalues within a specified range. The best you can do is to use "eigs" for a specified number of eigenvalues k near (omega1+omega2)/2:
eigs(K,M,k,(omega1+omega2)/2)
That's what you can get from AI:
In MATLAB, you can find eigenvalues within a specific range using the eigs function for sparse or large matrices, or by using eig combined with logical indexing for small, dense matrices.
Method 1: Using eigs (Best for Specific Ranges & Large Matrices)
The eigs function is designed to find a subset of eigenvalues, particularly those near a certain value (sigma).
  • Find eigenvalues closest to a value sigma: d = eigs(A, k, sigma)
  • Find eigenvalues in a specific numeric range (e.g., real part between a and b): eigs does not directly take an interval. Instead, you find eigenvalues near the midpoint of your range and then filter them, or use the 'smallestabs'/'largestabs' options.
  • Example: Find 5 eigenvalues near 10.0: d = eigs(A, 5, 10.0)
Method 2: eig + Logical Indexing (Best for Small Matrices)
For smaller matrices, calculate all eigenvalues and then filter them using logical operators.
% 1. Calculate all eigenvalues
all_eigs = eig(A);
% 2. Define range [min_val, max_val]
min_val = 2;
max_val = 5;
% 3. Find eigenvalues within the range
range_eigs = all_eigs(all_eigs >= min_val & all_eigs <= max_val);
Method 3: Generalized Eigenvalues in Range
To find eigenvalues of the pair (A,B) near a value sigma:
d = eigs(A, B, k, sigma)
Summary of eigs sigma options
sigma value Description
numeric Eigenvalues near sigma (e.g., eigs(A, 5, 10.0))
'smallestabs' Smallest magnitude eigenvalues
'largestabs' Largest magnitude eigenvalues (default)
'smallestreal' Smallest real part
'largestreal' Largest real part
Important Note: The numeric sigma cannot be exactly equal to an eigenvalue; if the target range is centered on a suspected eigenvalue, use a slightly shifted value, e.g., eigs(A, k, 4.0 + 1e-6).

Categorie

Scopri di più su Linear Algebra in Centro assistenza e File Exchange

Prodotti

Release

R2019b

Richiesto:

il 13 Apr 2026 alle 5:56

Modificato:

il 13 Apr 2026 alle 16:24

Community Treasure Hunt

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

Start Hunting!

Translated by