romtools.rom.projections#

Functions

optimal_l2_projection(input_tensor, vector_space)

Compute L2 projection in the weighted inner product.

romtools.rom.projections.optimal_l2_projection(input_tensor, vector_space, weighting_matrix=None, return_full_state=False)[source]#

Compute L2 projection in the weighted inner product.

\[\arg\min \| ( \Phi \hat{x} + x_{ref}) - x \|_M^2\]

Solution satisfies the linear system

\[\Phi^T M \Phi \hat{x} = \Phi^T M ( x - x_{ref} )\]
Parameters:
  • input_tensor (np.ndarray) – 2d or 3d data array of size (n_vars, nx) or (n_vars, nx, n_snaps)

  • vector_space (romtools.VectorSpace) – vector space class containing basis and affine offset

  • weighting_matrix (np.ndarray) – 2d weighting matrix of size \(nvars nx \times nvars nx\)