LinearOperator#
- class LinearOperator(entries=None)[source]#
Linear state operator \(\Ophat_{\ell}(\qhat,\u) = \Ahat\qhat\) where \(\Ahat \in \RR^{r \times r}\).
- Parameters
- entries(r, r) ndarray or None
Operator entries \(\Ahat\).
Examples
>>> import numpy as np >>> A = opinf.operators.LinearOperator() >>> entries = np.random.random((10, 10)) # Operator entries. >>> A.set_entries(entries) >>> A.shape (10, 10) >>> q = np.random.random(10) # State vector. >>> out = A.apply(q) # Apply the operator to q. >>> np.allclose(out, entries @ q) True
Properties
entries
Discrete representation of the operator, the matrix \(\Ohat\).
shape
Shape of the operator entries array.
state_dimension
Dimension of the state \(\qhat\) that the operator acts on.
Methods
Apply the operator to the given state / input: \(\Ophat_{\ell}(\qhat,\u) = \Ahat\qhat\).
Return a copy of the operator.
Return the data matrix block corresponding to the operator, the
states
.Return the Galerkin projection of the operator, \(\Ahat = \Wr\trp\A\Vr\).
Construct the state Jacobian of the operator: \(\ddqhat\Ophat_{\ell}(\qhat,\u)=\Ahat\).
Load an operator from an HDF5 file.
Column dimension \(r\) of the operator entries.
Save the operator to an HDF5 file.
Set the
entries
attribute.