add HN model with independent slopes

This commit is contained in:
Dominik Demuth 2023-07-19 18:36:13 +02:00
parent 3149a3f958
commit 5db6a9f2c5

View File

@ -54,10 +54,31 @@ class HavriliakNegamiBDS(_AbstractBDS):
name = 'Havriliak-Negami'
equation = r'\Delta\epsilon / [1-(i\omega\tau)^{\gamma}]^{\alpha}'
params = _AbstractBDS.params + [r'\alpha', r'\gamma']
bounds = _AbstractBDS.bounds + [(0, 1), (0, 1)]
bounds = _AbstractBDS.bounds + [(0, 1), (0, None)]
susceptibility = HavriliakNegami.susceptibility
class HavriliakNegamiAlphaGammaBDS:
type = 'Dielectric Spectroscopy'
name = 'Havriliak-Negami (ind. slopes)'
equation = r'\Delta\epsilon / [1-(i\omega\tau)^{\gamma}]^{\alpha}'
params = [r'\Delta\epsilon', r'\tau_{0}', r'\alpha', r'\alpha\gamma']
bounds = [(0, None), (0, None), (0, 1), (0, 1)]
iscomplex = True
@staticmethod
def func(x, deps, tau, alpha, alphagamma, complex_mode: int = 0, **kwargs):
chi = deps * HavriliakNegami.susceptibility(2*np.pi*x, tau, alpha, alphagamma/alpha, **kwargs)
if complex_mode == 0:
return chi
elif complex_mode == 1:
return chi.real
elif complex_mode == 2:
return chi.imag
else:
raise ValueError(f'{complex_mode!r} is not 0, 1, 2')
class KWWBDS(_AbstractBDS):
name = 'KWW'
params = _AbstractBDS.params + [r'\beta']