sierras module

A tool for empirical Arrhenius equation fitting.

In physical chemistry, the Arrhenius equation is an empirical formula for temperature dependence of a process given by the following equation

\[k = k_0 e^{-E / k_B T}\]

where

  • \(k\) is the thermally-induced process (diffusion coefficient, frequency of collision, crystal vacancies, among others),

  • \(k_0\) is the pre-exponential factor,

  • \(E\) is the activation energy of the process,

  • \(k_B\) is the Boltzmann constant, it could also be the universal gas constant \(R\),

  • \(T\) is the Temperature in Kelvin,

The exponential factor in this equation gives the probability that the process occurs and it denotes the fraction of atoms with energy greater than or equal than \(E\).

Taking the natural logarithm of this equation yields to a linear relationship

\[\ln k = \ln k_0 - \frac{E}{k_B} \left( \frac{1}{T} \right)\]

that can be fitted and used to extrapolate the process to room temperature, which is usually difficult to obtain directly, or to get the activation energy from the slope.

For more details read: https://en.wikipedia.org/wiki/Arrhenius_equation and/or https://en.wikipedia.org/wiki/Arrhenius_plot

class sierras.ArrheniusRegressor(constant=8.617333262e-05)

Bases: BaseEstimator, RegressorMixin

Arrhenius equation fitting.

Parameters:

constant (float, default=8.617333262e-5) – Either the universal gas constant, \(R\), or the Boltzmann constant, \(k_B\), default value is the later in eV/K units.

activation_energy_

Activation energy of the process, this is the same as -self.constant * self.reg_.coef_[0].

Type:

float

extrapolated_process_

The extrapolation at room temperature of the thermally-induced process, note that this is the same that self.predict(np.array([[300.0]]))[0].

Type:

float

reg_

The linear regressor for \(\ln k\) versus \(\frac{1}{T}\).

Type:

sklearn.linear_model.LinearRegressor

fit(X, y, sample_weight=None, **kwargs)

Fit the Arrhenius empirical equation.

Parameters:
  • X (array-like of shape (n_samples, 1)) – Temperature data.

  • y (array-like of shape (n_samples,)) – Target values of the thermally-induced process.

  • sample_weight (array-like of shape (n_samples,), defualt=None) – Individual weight of each thermally-induced value.

  • **kwargs – Keyword arguments that are passed and are documented in sklearn.linear_model.LinearRegression.

predict(X)

Predict the thermally-induced process values.

Parameters:

X (array-like of shape (n_samples, 1)) – Temperature data.

to_dataframe(X, y, sample_weight=None)

Convert the data with the predictions to a pandas.DataFrame.

Parameters:
  • X (array-like of shape (n_samples, 1)) – Temperature data.

  • y (array-like of shape (n_samples,)) – Target values of the thermally-induced process.

  • sample_weight (array-like of shape (n_samples,), defualt=None) – Individual weight of each thermally-induced value.

Returns:

A pandas.DataFrame with the data.

Return type:

pandas.DataFrame

plot(ax=None, data_kws=None, pred_kws=None)

Arrhenius plotter.

Parameters:
  • ax (matplotlib.axes.Axes, default=None) – The current axes.

  • data_kws (dict, default=None) – Additional keyword arguments that are passed and are documented in matplotlib.axes.Axes.errorbar for the data points.

  • pred_kws (dict, default=None) – Additional keyword arguments that are passed and are documented in matplotlib.axes.Axes.plot for the predictions values.

Returns:

ax – The current axes.

Return type:

matplotlib.axes.Axes