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.

shape#

Shape \((r, m)\) of the operator matrix \(\Bhat\).

state_dimension#

Dimension \(r\) of the state \(\qhat\) that the operator acts on.

Methods:

apply

Apply the operator to the given state / input: \(\Ophat_{\ell}(\qhat,\u) = \Bhat\u\).

copy

Return a copy of the operator.

datablock

Return the data matrix block corresponding to the operator, the inputs.

galerkin

Return the Galerkin projection of the operator, \(\Bhat = (\Wr\trp\Vr)^{-1}\Wr\trp\B\).

jacobian

Construct the state Jacobian of the operator.

load

Load an operator from an HDF5 file.

operator_dimension

Column dimension \(m\) of the operator matrix \(\Bhat\).

save

Save the operator to an HDF5 file.

set_entries

Set the operator matrix \(\Bhat\).

verify

Verify consistency between dimension properties and required methods.