Update src/nmreval/models/temperature.py

Add Tanaka model
This commit is contained in:
2025-07-02 10:11:47 +00:00
parent 5975c08fb2
commit 65dde66ffc

View File

@ -1,3 +1,5 @@
from __future__ import annotations
import numpy as np import numpy as np
from ..utils.constants import kB from ..utils.constants import kB
@ -72,3 +74,25 @@ class Ecoop:
ec = e_infty * np.exp(-mu * (x - ta) / e_infty) ec = e_infty * np.exp(-mu * (x - ta) / e_infty)
return tau0 * np.exp((e_infty + ec) / x) return tau0 * np.exp((e_infty + ec) / x)
class Tanaka:
name = 'Tanaka two-state model'
type = 'Temperature'
equation = r'\tau_0 exp[(E_{a}^{f} + (E_{a}^{s}-E_{a}^{f})[1/(1+exp[(\DeltaE-T \Delta\sigma)/(k_{}B T)])]/(k_{B} T)]'
params = [r'\tau_{0}', 'E_{a}^{f}', 'E_{a}^{s}', r'\DeltaE', r'\Delta\sigma']
bounds = [(0, None), (0, None), (0, None), (None, 0), (None, 0)]
choices = [('temperature', 'temp_axis', {'T': 'T', '1000 K/T': '1000/T'})]
@staticmethod
def func(x, tau0: float, ea_f: float, ea_s: float, e_D: float, sigma_D: float, temp_axis: str = 'T'):
if temp_axis == '1000/T':
x = 1000/x
kT = kB * x
exponent = 1 / (1 + np.exp((e_D - x * sigma_D) / kT))
return tau0 * np.exp((ea_f + (ea_s - ea_f) * exponent) / kT)