svdval_decay()#
- svdval_decay(singular_values, threshold: float = 1e-08, plot: bool = True, right=None, ax=None, **kwargs)[source]#
Count the number of normalized singular values that are greater than a specified threshold.
- Parameters
- singular_values(n,) ndarray
Singular values of a snapshot matrix, e.g.,
scipy.linalg.svdvals(states)
.- thresholdfloat or list[floats]
Cutoff value(s) for the singular values.
- plotbool
If
True
, plot the singular values and the cutoff value(s) against the singular value index.- rightint or None
Maximum singular value index to plot (
plt.xlim(right=right)
).- axplt.Axes or None
Axes to plot the results on if
plot=True
. If not given, a new single-axes figure is created.- kwargsdict
Options to pass to
plt.semilogy()
- Returns
- ranksint or list(int)
Number of singular values greater than the cutoff value(s).