AffineQuadraticOperator#
- class AffineQuadraticOperator(coeffs, nterms: int = None, entries=None, fromblock: bool = False)[source]#
Affine-parametric quadratic operator \(\Ophat_{\ell}(\qhat,\u;\bfmu) = \Hhat_{\ell}(\bfmu)[\qhat\otimes\qhat] = \left( \sum_{a=0}^{A_{\ell}-1}\theta_{\ell}^{(a)}\!(\bfmu)\,\Hhat_{\ell}^{(a)} \right)[\qhat\otimes\qhat].\)
Here, each \(\theta_\ell^{(a)}:\RR^{p}\to\RR\) is a scalar-valued function of the parameter vector and each \(\Hhat_{\ell}^{(a)} \in \RR^{r\times r^2}\) is a constant matrix, see
opinf.operators.QuadraticOperator
.- Parameters:
- coeffscallable, (iterable of callables), or int
Coefficient functions for the terms of the affine expansion.
If callable, it should receive a parameter vector \(\bfmu\) and return the vector of affine coefficients, \([~\theta_{\ell}^{(0)}(\bfmu) ~~\cdots~~\theta_{\ell}^{(A_{\ell}-1)}(\bfmu)~]\trp\). In this case,
nterms
is a required argument.If an iterable, each entry should be a callable representing a single affine coefficient function \(\theta_{\ell}^{(a)}\).
If an integer \(p\), set \(A_{\ell} = p\) and define \(\theta_{\ell}^{(i)}\!(\bfmu) = \mu_i\). This is equivalent to using
coeffs=lambda mu: mu
, except the parameter dimension is also captured andnterms
is not required.
- entrieslist of ndarrays, or None
Operator matrices for each term of the affine expansion, i.e., \(\Hhat_{\ell}^{(0)},\ldots,\Hhat_{\ell}^{(A_{\ell}-1)}.\) If not provided in the constructor, use
set_entries()
later.- fromblockbool
If
True
, interpretentries
as a horizontal concatenation of arrays; ifFalse
(default), interpretentries
as a list of arrays.
Properties:- entries#
Operator matrices for each term of the affine expansion, i.e., \(\Ohat_{\ell}^{(0)},\ldots,\Ohat_{\ell}^{(A_{\ell}-1)}.\)
- nterms#
Number of terms \(A_{\ell}\) in the affine expansion.
- parameter_dimension#
Dimension \(p\) of the parameter vector \(\bfmu\) that the operator matrix depends on.
- shape#
Shape of the operator matrix when evaluated at a parameter value.
- state_dimension#
Dimension \(r\) of the state \(\qhat\) that the operator acts on.
Methods:Apply the operator to the given state and input at the specified parameter value, \(\Ophat_\ell(\qhat,\u;\bfmu)\).
Evaluate the coefficient functions for each term of the affine expansion for a given parameter vector.
Return a copy of the operator.
Return the data matrix block corresponding to the operator.
Evaluate the operator at the given parameter value.
Project this operator to a low-dimensional linear space.
Construct the state Jacobian of the operator, \(\ddqhat\Ophat_\ell(\qhat,\u;\bfmu)\).
Load an affine parametric operator from an HDF5 file.
Number of columns in the concatenated operator matrix.
Save the operator to an HDF5 file.
Set the operator matrices for each term of the affine expansion.
Verify dimension attributes and
evaluate()
.