InputOperator#
- class InputOperator(entries=None)[source]#
Linear input operator \(\Ophat_{\ell}(\qhat,\u) = \Bhat\u\) where \(\Bhat \in \RR^{r \times m}\).
- Parameters:
- entries(r, m) ndarray or None
Operator matrix \(\Bhat\).
Examples
>>> import numpy as np >>> B = opinf.operators.LinearOperator() >>> entries = np.random.random((10, 3)) # Operator matrix. >>> B.set_entries(entries) >>> B.shape (10, 3) >>> u = np.random.random(3) # Input vector. >>> out = B.apply(None, u) # Apply the operator to u. >>> np.allclose(out, entries @ u) True
Properties:- entries#
Operator matrix \(\Bhat\).
- input_dimension#
Dimension \(m\) of the input \(\u\) that the operator acts on.
- my_input_dimension = None#
- shape#
Shape \((r, m)\) of the operator matrix \(\Bhat\).
- state_dimension#
Dimension \(r\) of the state \(\qhat\) that the operator acts on.
Methods:Apply the operator to the given state / input: \(\Ophat_{\ell}(\qhat,\u) = \Bhat\u\).
Return a copy of the operator.
Return the data matrix block corresponding to the operator, the
inputs.Creates a new operator of type InputOperator of the same input dimension as this one but for the reduced (test) dimension
new_r_test(defaulted tonew_r_test = new_rif not provided).Return the Galerkin projection of the operator, \(\Bhat = (\Wr\trp\Vr)^{-1}\Wr\trp\B\).
Construct the state Jacobian of the operator.
Load an operator from an HDF5 file.
Column dimension \(m\) of the operator matrix \(\Bhat\).
Creates a new operator of type InputOperator for the reduced (test) dimension
len(indices_test)(Petrov-Galerkin setting).Save the operator to an HDF5 file.
Set the operator matrix \(\Bhat\).
Verify consistency between dimension properties and required methods.