plot_cumulative_energy()

plot_cumulative_energy()#

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

Plot the cumulative singular value energy and a function of the basis size.

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

\[\kappa_r = \sum_{i=1}^r\sigma_i^2 \bigg/ \sum_{j=1}^k\sigma_j^2.\]

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

Parameters:
thresholdfloat or list[float] or None

Threshold energy 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.

kwargsdict

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

Returns:
axmatplotlib.Axes

Axes for the plot.