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 matrix \(\Ahat\).
Examples
>>> import numpy as np >>> A = opinf.operators.LinearOperator() >>> entries = np.random.random((10, 10)) # Operator matrix. >>> 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#
Operator matrix \(\Ahat\).
- shape#
Shape \((r, r)\) of the operator matrix \(\Ahat\).
- 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) = \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\Vr)^{-1}\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 matrix \(\Ahat\).
Save the operator to an HDF5 file.
Set the operator matrix \(\Ahat\).
Verify consistency between dimension properties and required methods.