method_of_snapshots()#
- method_of_snapshots(states, inner_product_matrix=None, minthresh: float = 1e-15, **options)[source]#
Use the method of snapshots to compute the left singular values of a collection of state snapshots.
For a snapshot matrix \(\Q\in\RR^{n\times k}\) (usually with \(n \ge k\)) and a weighting matrix \(\W\in\RR^{n\times n}\), the method of snapshots computes the symmetric eigendecomposition
\[\Q\trp\W\Q = \bfPsi\bfLambda\bfPsi\trp.\]The matrix \(\bfPsi\in\RR^{k\times k}\) consists of the right singular vectors of \(\Q\) and \(\bfLambda\in\RR^{k\times k}\) is a diagonal matrix containing the square of the singular values of \(\Q\). The (weighted) left singular vectors are then given by \(\bfPhi = \Q\bfPsi\bfLambda^{-1/2} \in \RR^{n \times k}\) and satisfy \(\Q = \bfPhi\bfLambda^{1/2}\bfPsi\trp\) and \(\bfPhi\trp\W\bfPhi = \I\).
- Parameters:
- states(n, k) ndarray,
Snapshot matrix \(\Q\) from which to compute the POD vectors.
- inner_product_matrix(n, n) sparse SPD matrix or None
Spatial inner product matrix \(\W\) for measuring how different indices in the snapshot matrix interact with each other. If not provided, default to the standard Euclidean inner product (\(\W = \I\)).
- minthreshfloat > 0
Threshold at which to truncate small eigenvalues. Singular vectors corresponding to eigenvalues that are less than this threshold are not included in the returned arrays.
- optionsdict
Additional arguments for
scipy.linalg.eigh()
.
- Returns:
- V(n, k’) ndarray, k’ <= k
Left singular vectors \(\bfPhi\).
- svals(k’,) ndarray, k’ <= k
Singular values \(\operatorname{diag}(\bfLambda^{1/2})\) in descending order.
- eigvecsT(k’, k’) ndarray
Transposed right singular vectors \(\bfPsi\trp\).
Notes
If, due to numerical precision errors,
scipy.linalg.eigh()
returns any negative eigenvalues, thenminthresh
is increased to the absolute value of the most negative eigenvalue.