scimba_torch.plots.plot_time_discrete_scheme

Plotting functions (generic in geometric dimension) for time-discrete schemes.

Functions

plot_time_discrete_scheme(scheme, **kwargs)

Plot an approximation space obtained with a time-discrete solver.

plot_time_discrete_scheme(scheme, **kwargs)[source]

Plot an approximation space obtained with a time-discrete solver.

Parameters:
Keyword Arguments:
  • parameters_values – a (list of) point(s) in the parameters domain, or “mean” or “random”, defaults to “mean”,

  • velocity_values – a list of point(s) in the velocity domain,

  • derivatives – a list of strings representing the derivatives to be plot, for instance “uxx”; defaults to [],

  • solution – a callable depending on the same args as space to be plot,

  • error – plot the absolute error with respect to the given solution,

  • title – a str

  • ... – see examples

Return type:

None

Implemented only for 1 and 2 dimensional spaces

Raises:
  • AttributeError – some arguments are missing necessary attributes

  • NotImplementedError – some option combinations are not implemented yet

Examples

>>> import matplotlib.pyplot as plt
>>> from scimba_torch.plots.plot_time_discrete_scheme
        import plot_time_discrete_scheme
>>> ...
>>> def exact(t: LabelTensor, x: LabelTensor, mu: LabelTensor):
        ...
>>> plot_time_discrete_scheme(
        scheme,
        solution=exact,
        error=exact,
        derivatives=["ux"],
    )
>>> plt.show()