ParticleScatteringPlot
Examples using this class are:
- class osaft.plotting.scattering.particle_plots.ParticleScatteringPlot(sol, resolution=100, n_quiver_points=21, cmap='winter')[source]
Bases:
BaseScatteringPlotsClass for plotting scattering field of the particle
Plots the acoustic field inside the particle using Matplotlib tricontourf or tripcolor plotting methods.
- Parameters
sol (BaseScattering) – solution to be plotted
resolution (int | tuple[int, int], optional) – if tuple (radial resolution, tangential resolution)
Default:100n_quiver_points (int, optional) – anchor points along z for quiver
Default:21cmap (str, optional) – color map
Default:'winter'Public Methods:
plot_velocity([inst, phase, mode, ...])Tricontourf plot for acoustic velocity field of the particle
animate_velocity([frames, interval, mode, ...])Tricontourf animation for acoustic velocity field of the particle
plot_velocity_evolution([inst, mode, ...])Tricontourf plot for acoustic velocity field evolution of the particle
- animate_velocity(frames=64, interval=100.0, mode=None, displacement=True, symmetric=True, quiver_color=None, tripcolor=False, ax=None, **kwargs)[source]
Tricontourf animation for acoustic velocity field of the particle
Animates the velocity amplitude of the first-order acoustic velocity field of the particle over one period using Matplotlib’s tricontourf or tripcolor if
tripcolor = True.- Parameters
frames (int, optional) – number of frames for the animation
Default:64interval (float, optional) – interval between frames in ms
Default:100.0mode (None | int, optional) – mode of oscillation
Default:Nonedisplacement (bool, optional) – if
Truedisplacement, else velocity plotDefault:Truesymmetric (bool, optional) – if
Truethe symmetry of the solution is usedDefault:Truequiver_color (None | str, optional) – color of the quiver arrows, if None: no arrows
Default:Nonetripcolor (bool, optional) – switches between tripcolor and tricontourf plot
Default:Falseax (None | plt.Axes, optional) – Axes object
Default:Nonekwargs – passed through to tricontourf()
- Return type
FuncAnimation
- plot_velocity(inst=True, phase=0, mode=None, displacement=False, symmetric=True, quiver_color=None, tripcolor=False, ax=None, **kwargs)[source]
Tricontourf plot for acoustic velocity field of the particle
Plots the velocity amplitude of the first-order acoustic velocity field of the particle using Matplotlib’s tricontourf or tripcolor if
tripcolor = True.- Parameters
inst (bool, optional) – if
Trueinstantaneous amplitude is plottedDefault:Truephase (float, optional) – phase \([0, 2\pi]\)
Default:0mode (None | int, optional) – mode of oscillation
Default:Nonedisplacement (bool, optional) – if
Truedisplacement, else velocity plotDefault:Falsesymmetric (bool, optional) – if
Truethe symmetry of the solution is usedDefault:Truequiver_color (None | str, optional) – color of the quiver arrows, if None: no arrows
Default:Nonetripcolor (bool, optional) – switches between tripcolor and tricontourf plot
Default:Falseax (None | plt.Axes, optional) – Axes object
Default:Nonekwargs – passed through to tricontourf()
- Return type
tuple[plt.Figure, plt.Axes]
- plot_velocity_evolution(inst=True, mode=None, displacement=False, symmetric=True, quiver_color=None, tripcolor=False, layout=(3, 3), **kwargs)[source]
Tricontourf plot for acoustic velocity field evolution of the particle
Plots the velocity amplitude of the first-order acoustic velocity field of the fluid over one period at different phases using Matplotlib’s tricontourf or tripcolor if
tripcolor = True.The first phase value is always \(0\pi\) and the last one \(2\pi\). The total number of plots and, hence, also the steps between the different phase values is the defined by the product of the
layouttuple.- Parameters
inst (bool, optional) – if
Trueinstantaneous amplitude is plottedDefault:Truemode (None | int, optional) – mode of oscillation
Default:Nonedisplacement (bool, optional) – if
Truedisplacement, else velocity plotDefault:Falsesymmetric (bool, optional) – if
Truethe symmetry of the solution is usedDefault:Truequiver_color (str, optional) – color of the quiver arrows, if None: no arrows
Default:Nonetripcolor (bool, optional) – switches between tripcolor and tricontourf plot
Default:Falselayout (tuple[int, int], optional) – number of rows and columns for plotting
Default:(3, 3)kwargs – passed through to the parent subplots command
- Return type
tuple[plt.Figure, plt.Axes]