rizer.kin.rate_fit_common#
Shared fitting/grouping machinery for the Arrhenius and Druyvesteyn rate fits.
Classes#
Fields and unit conversions shared by ArrheniusRate and DruyvesteynRate. |
Functions#
|
Fit |
|
Group ArrheniusRate/DruyvesteynRate by equation, sorted by fit cost. |
Module Contents#
- rizer.kin.rate_fit_common.fit_log_linear_rate(k: numpy.ndarray, temperatures: numpy.ndarray, inverse_temperature_exponent: int, ea_lower_bound: float) tuple[float, float, float, float]#
Fit
log(k(T)) = log(A) + b * log(T) - x / T**inverse_temperature_exponent.Shared linear least-square core of k_fit_arrhenius_lstsq (exponent 1, x = Ea) and k_fit_druyvesteyn_lstsq (exponent 2, x = Ea**2); callers convert the fitted x to Ea themselves since the two models parametrize it differently.
- Parameters:
k (
numpy.ndarray) – Rate constant to be fitted.temperatures (
numpy.ndarray) – Temperatures at which the rate constant is computed, in Kelvin.inverse_temperature_exponent (
int) – Power of 1/T in the exponential term (1 for Arrhenius, 2 for Druyvesteyn).ea_lower_bound (
float) – Lower bound on the fitted x term.
- Returns:
Fitted A, b, x and the cost function.
- Return type:
- Raises:
ValueError – If the least square optimization failed.
- class rizer.kin.rate_fit_common.RateFit#
Fields and unit conversions shared by ArrheniusRate and DruyvesteynRate.
- electron_temperature: numpy.ndarray#
- k_raw: numpy.ndarray#
- rizer.kin.rate_fit_common.group_and_sort_rates_by_equation[T: RateFit](rates: list[T], janev_cross_section_first: bool = False) dict[str, list[T]]#
Group ArrheniusRate/DruyvesteynRate by equation, sorted by fit cost.
Shared by group_and_sort_arrhenius_rate_by_equation and group_and_sort_druyvesteyn_rate_by_equation.
- Parameters:
- Returns:
Dictionnary where equation are mapped to corresponding list of rates.
- Return type: