CADETProcess.solution.SolutionIO#

class CADETProcess.solution.SolutionIO(name, time, component_system, solution, c_min)[source]#

Bases: SolutionBase

Solution representing streams at the inlet or outlet of a UnitOperation.

Notes

The flow_rate attribute is implemented as TimeLine to improve interpolation of signals with discontinuous flow.

property antiderivative: SolutionIO#

SolutionIO: Antiderivative of this solution.

create_fraction(start: float | None = None, end: float | None = None) Fraction[source]#

Create fraction in interval [start, end].

Parameters:
startOptional[float]

Start time of the fraction. If None, the first time point is used. The default is None.

end: Optional[float]

End time of the fraction. If None, the last time point is used. The default is None.

Returns:
Fraction

a Fraction object in the interval [start, end]

property derivative: SolutionIO#

SolutionIO: Derivative of this solution.

dimensions = ['time', 'component_coordinates']#
property dm_dt_interpolated: InterpolatedSignal#

Return the dm/dt interpolated signal.

fraction_mass(start: float | None = None, end: float | None = None) ndarray[source]#

Component mass in a fraction interval.

Parameters:
startOptional[float]

Start time of the fraction. If None, the first time point is used. The default is None.

end: Optional[float]

End time of the fraction. If None, the last time point is used. The default is None.

Returns:
np.ndarray

Mass of all components in the fraction.

fraction_volume(start: float | None = None, end: float | None = None) float[source]#

Volume of a fraction interval.

Parameters:
startOptional[float]

Start time of the fraction. If None, the first time point is used. The default is None.

end: Optional[float]

End time of the fraction. If None, the last time point is used. The default is None.

Returns:
float

Volume of the fraction

integral(start: float | None = None, end: float | None = None) ndarray[source]#

Peak area in a fraction interval.

Parameters:
startOptional[float]

Start time of the fraction. If None, the first time point is used. The default is None.

end: Optional[float]

End time of the fraction. If None, the last time point is used. The default is None.

Returns:
np.ndarray

Area of each component in the fraction.

normalize() SolutionIO[source]#

SolutionIO: Normalize the solution using the transformation function.

offset(offset: float) SolutionIO[source]#

Shift solution by an offset.

plot(start: float | None = None, end: float | None = None, components: list[str] | None = None, x_axis_in_minutes: bool = True, *args: Any, **kwargs: Any) tuple[Figure, Axes | tuple[Axes]][source]#

Plot the entire time_signal for each component.

Parameters:
startfloat | None, optional, default=None

Start time for plotting in seconds. If None, the first data point is used.

endfloat | None, optional, default=None

End time for plotting in seconds. If None, the last data point is used.

componentslist[str] | None, optional, default=None

List of components to be plotted. If None, all components are plotted.

x_axis_in_minutesbool, optional, default=True

If True, the x-axis is displayed in minutes instead of seconds.

*argsAny

Optional arguments passed to _plot_solution_1D.

**kwargsAny

Optional keyword arguments passed to _plot_solution_1D.

Returns:
tuple[plt.Figure, plt.Axes | tuple[plt.Axes]]

The Matplotlib Figure and Axes objects.

See also

_plot_solution_1D

Low-level function for 1D plotting.

slice_solution

Slice the solution for plotting.

plot_purity

Plot purity-related data.

CADETProcess.plotting

Plotting library utilities.

plot_purity(start: float | None = None, end: float | None = None, components: list[str] | None = None, x_axis_in_minutes: bool = True, plot_components_purity: bool = True, plot_species_purity: bool = False, alpha: float = 1.0, xlabel: str | None = None, ylim: tuple[float, float] | None = None, ylabel: str | None = None, hide_labels: bool = False, hide_species_labels: bool = False, show_legend: bool = True, update_layout: bool = True, ax: Axes | tuple[Axes] | None = None, setup_figure_kwargs: dict | None = None) tuple[Figure, Axes][source]#

Plot local purity for each component of the concentration profile.

Parameters:
startfloat | None, optional, default=None

Start time for plotting in seconds. If None, the first data point is used.

endfloat | None, optional, default=None

End time for plotting in seconds. If None, the last data point is used.

componentslist[str] | None, optional, default=None

List of components to be plotted. If None, all components are plotted.

x_axis_in_minutesbool, optional, default=True

If True, the x-axis is displayed in minutes instead of seconds.

plot_components_puritybool, optional

If True, plot purity of total component concentration. Default is True.

plot_species_puritybool, optional

If True, plot purity of individual species. Default is False.

alphafloat, default=1.0

Opacity of plotted lines.

ylimtuple[float, float] | None, default=None

Y-axis limits.

hide_labelsbool, default=False

If True, hide labels in the legend.

hide_species_labelsbool, default=False

If True, hide species labels in the legend.

secondary_axeslist[SecondaryAxis] | None, default=None

List of SecondaryAxis objects for secondary axes.

show_legendbool, default=True

If True, display the legend.

update_layoutbool, optional, default=True

If True, update layout.

axplt.Axes | tuple[plt.Axes] | None, default=None

Optional Matplotlib Axes. If not provided, a new figure is created.

setup_figure_kwargsdict | None, default=None

Additional options to setup the figure.

Returns:
tuple[plt.Figure, plt.Axes]

The Matplotlib Figure and Axes objects.

Raises:
CADETProcessError

If the solution has fewer than 2 components.

resample(start: float | None = None, end: float | None = None, nt: int | None = 5001) SolutionIO[source]#

Resample solution to nt time points.

Parameters:
startOptional[float]

Start time of the fraction. If None, the first time point is used. The default is None.

end: Optional[float]

End time of the fraction. If None, the last time point is used. The default is None.

ntint, optional

Number of points to resample. The default is 5001.

Returns:
SolutionIO

The resampled solution object.

smooth_data(s: float | list[float] | None = None, crit_fs: float | list[float] | None = None, crit_fs_der: float | list[float] | None = None) SolutionIO[source]#

Smooth data.

Parameters:
sOptional[float | list[float]]

DESCRIPTION.

crit_fsOptional[float | list[float]]

DESCRIPTION.

crit_fs_derOptional[float | list[float]]

DESCRIPTION.

Returns:
SolutionIO

The smoothed solution object.

property solution_interpolated: InterpolatedSignal#

InterpolatedSignal: The interpolated signal.

update_solution() None[source]#

Update solution method.

update_transform() None[source]#

Update the Transformer.