plot_residual_energy()

plot_residual_energy()#

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

Plot the residual singular value energy as a function of the basis size.

The residual energy of \(r\) singular values is defined by

\[\epsilon_r = \sum_{i=r+1}^k\sigma_i^2 \bigg/ \sum_{j=1}^k\sigma_j^2 = 1 - \left( \sum_{i=1}^r\sigma_i^2 \bigg/ \sum_{j=1}^k\sigma_j^2 \right)\]

This method plots \(\epsilon_r\) as a function of \(r\).

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.