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 entries \(\Bhat\).

Examples

>>> import numpy as np
>>> B = opinf.operators.LinearOperator()
>>> entries = np.random.random((10, 3))     # Operator entries.
>>> 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

Discrete representation of the operator, the matrix \(\Ohat\).

input_dimension

Dimension of the input \(\u\) that the operator acts on.

shape

Shape of the operator entries array.

state_dimension

Dimension 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\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 entries.

save

Save the operator to an HDF5 file.

set_entries

Set the entries attribute.