galerkin()#

ParametricOpInfOperator.galerkin(Vr, Wr=None)#

Get the (Petrov-)Galerkin projection of this operator.

Consider an operator \(\Op(\q,\u)\), where \(\q\in\RR^n\) is the state and \(\u\in\RR^m\) is the input. Given a trial basis \(\Vr\in\RR^{n\times r}\) and a test basis \(\Wr\in\RR^{n\times r}\), the Petrov-Galerkin projection of \(\Op\) is the operator \(\Ophat:\RR^r\times\RR^m\to\RR^r\) defined by

\[\Ophat(\qhat, \u) = (\Wr\trp\Vr)^{-1}\Wr\trp\Op(\Vr\qhat, \u)\]

where \(\qhat\in\RR^n\) approximates the original state via \(\q \approx \Vr\qhat\).

Parameters:
Vr(n, r) ndarray

Basis for the trial space.

Wr(n, r) ndarray or None

Basis for the test space. If None, defaults to Vr.

Returns:
opoperator

New object of the same class as self whose state_dimension attribute equals r. If this operator acts on inputs, the input_dimension attribute of the new operator should be self.input_dimension.