plot_projection_error()

plot_projection_error()#

PODBasis.plot_projection_error(threshold=None, right: int = None, ax: Axes = None, **options)[source]#

Plot the relative projection error of the training snapshots as a function of the basis size.

The relative projection error for the rank-\(r\) POD basis corresponding to the training snapshot matrix \(\Q\in\RR^{n\times k}\) is defined by

\[\rho_r = \frac{\|\Q - \Vr\Vr\trp\Q\|_{F}}{\|\Q\|_{F}},\]

where \(\Vr\in\RR^{n \times r}\) are the basis entries. This method plots \(\rho_r\) as a function of \(r\); \(\rho_r\) is calculated via the singular values:

\[\rho_r = \sqrt{\frac{\sum_{j = r + 1}^{\ell}\sigma_{j}^{2}}{ \sum_{j=1}^{\ell}\sigma_{j}^{2}}}\]
Parameters:
thresholdfloat or list[float] or None

Cutoff value(s) to mark on the plot.

rightint or None

Maximum singular value index to plot (plt.xlim(right=right)).

axmatplotlib.Axes or None

Axes to plot on. If None (default), a new single-axes figure is created.

optionsdict

Options to pass to matplotlib.pyplot.semilogy().

Returns:
axmatplotlib.Axes

Axes for the plot.

Notes

This method shows the projection error of the training snapshots. See projection_error() to calculate the projection error for an arbitrary snapshot or collection of snapshots.