Scope

WasteStreamScope

class qsdsan.utils.WasteStreamScope(wastestream)

A tracker of the dynamic component concentrations and volumetric flowrates of a WasteStream.

Parameters:

wastestream (WasteStream) – The WasteStream object to keep track of during dynamic simulation. Must have a state attribute

plot_time_series(state_var=())

Plot the time series data of specified state variables.

Parameters:

state_var (str or Iterable[str]) – Name of the state variables to plot.

SanUnitScope

class qsdsan.utils.SanUnitScope(unit)

A tracker of the dynamic state variables of a SanUnit.

Parameters:

unit (SanUnit) – The SanUnit object to keep track of during dynamic simulation. Must have a ‘_state’ attribute.

plot_time_series(state_var=())

Plot the time series data of specified state variables.

Parameters:

state_var (str or Iterable[str]) – Name of the state variables to plot.

biosteam.utils.Scope

class biosteam.utils.Scope(subject, variables, header=None, **kwargs)

A general tracker of attributes of a subject during dynamic simulations.

Parameters:
  • subject – The subject to scope during dynamic simulation.

  • variables (Iterable[str]) – The attributes to track.

  • header (list of 2-tuple or pandas.MultiIndex, optional) – The header for the tracked time-series data. When none specified, will be auto-generated based on the defined variables to track.

getter(variable)

A function to receive the attribute or variable of interest.

property header

[list of 2-tuple] Header for the tracked time-series data.

plot_time_series(variable)

plot the time series data of a single variable of interest

pop()

Removes the last tracked time point.

property record

[numpy.ndarray] The tracked time-series data of the variables of interest.

reset_cache()

Clears all recorded data.

property time_series

[numpy.1darray] The tracked time points.

biosteam.utils.SystemScope

class biosteam.utils.SystemScope(system, *subjects, interpolator=None, **kwargs)

A class for keeping track of time-series data generated during dynamic simulation of a system.

Parameters:
  • system (System) – The System object to track.

  • *subjects – The subjects of interest to scope during dynamic simulation, e.g., a Unit object or a Stream object with dynamic state variables.

  • interpolator (callable, optional) – An interpolation method that takes in time-series data and returns an interpolant. Used to export the data at certain time points. When none specified, will use scipy.interpolate.InterpolatedUnivariateSpline with k=1 (i.e., linear) and will raise error when trying to extrapolate.

export(path='', t_eval=None, **interpolation_kwargs)

Exports recorded time-series data to given path.

reset_cache()

Clears all recorded data.

property sol_header

[list of 2-tuple or pandas.MultiIndex]The header for the solution data returned by the IVP solver.

property subjects

The subjects of interest to scope during dynamic simulation.

property time_series

[numpy.1darray] The tracked time points.