pod_basis()

Contents

pod_basis()#

pod_basis(states, num_vectors: int = None, svdval_threshold: float = None, cumulative_energy: float = None, residual_energy: float = None, projection_error: float = None, svdsolver: str = 'dense', weights: ndarray = None, return_rightvecs: bool = False, **svdsolver_options)[source]#

Compute a POD basis from the given states.

Parameters:
states(n, k) ndarray

Matrix of \(k\) \(n\)-dimensional snapshots.

return_rightvecbool

If True, return the right singular vectors as well.

Returns:
basis(n, r) ndarray

POD basis matrix, the first \(r\) left singular vectors of the states.

svdvals(n,), (k,), or (r,) ndarray

Normalized singular values in descending order. Always returns as many as are calculated: \(\min\{n, k\}\) for svdsolver="dense", \(r\) for svdsolver="randomized".

rightvecs(k, r) ndarray

First \(r\) right singular vectors, as columns. Only returned if return_rightvecs=True.

Notes

See PODBasis for the mathematical definition of POD and for details on other function arguments.