opinf.post#

Tools for computing errors of reduced-order model solutions.

Absolute and Relative Error#

Given a norm \(\|\cdot\|\), “true” data \(\Q\), and an approximation \(\breve{\Q}\) to \(\Q\), the absolute and relative errors of the approximation \(\breve{\Q}\) are defined as

\[ \begin{align*} e_{\text{absolute}} = \|\Q - \breve{\Q}\|, \qquad e_{\text{relative}} = \frac{e_{\text{absolute}}}{\|\Q\|} = \frac{\|\Q - \breve{\Q}\|}{\|\Q\|}. \end{align*} \]

In the context of this package, \(\Q\in\RR^{n \times k}\) is typically a matrix whose \(j\)-th column is the true state vector at time \(t_{j}\), and the approximation \(\breve{\Q}\in\RR^{n\times k}\) is the corresponding matrix of reduced-order model solutions.

Projection Error#

The projection error is defined by the low-dimensional representation of the state, not the solution of a reduced-order model per se. For a true state \(\q \in \RR^{n}\), consider the low-dimensional (linear) approximation

\[ \begin{align*} \breve{\q} = \Vr\qhat, \end{align*} \]

where \(\Vr\in\RR^{n\times r}\). The projection error associated with this approximation is

\[ \begin{align*} \|\q - \breve{\q}\| = \|\q - \Vr\Vr\trp\q\|. \end{align*} \]

The following function computes this projection error, given a basis matrix \(\Vr\).

projection_error

Calculate the absolute and relative projection errors induced by projecting states to a low dimensional basis, i.e.,

Basis classes such as opinf.basis.PODBasis also have a projection_error() method.

Reduced-order Model Error#

The following functions compute the error between a true state solution \(\q(t) \in \RR^{n}\) of the system of interest and an approximation \(\breve{\q}(t) \in \RR^{n}\) generated by a reduced-order model. Each uses a different norm to measure the absolute and relative errors.

frobenius_error

Compute the absolute and relative Frobenius-norm errors between the snapshot sets Qtrue and Qapprox, where Qapprox approximates Qtrue:

lp_error

Compute the absolute and relative lp-norm errors between the snapshot sets Qtrue and Qapprox, where Qapprox approximates to Qtrue:

Lp_error

Compute the absolute and relative Lp-norm error (with respect to time) between the snapshot sets Qtrue and Qapprox, where Qapprox approximates Qtrue: