From cde794cb0d4f69c86d53ed9a3c8248f842dc7a84 Mon Sep 17 00:00:00 2001 From: Dominik Demuth Date: Thu, 28 Sep 2023 17:55:25 +0200 Subject: [PATCH] parabola on a log-scale added --- src/nmreval/models/basic.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/nmreval/models/basic.py b/src/nmreval/models/basic.py index 98be0f8..411e218 100644 --- a/src/nmreval/models/basic.py +++ b/src/nmreval/models/basic.py @@ -133,6 +133,30 @@ class Parabola: return c * (x-x0)**2 + y0 +class ParabolaLog: + """ + Parabola (on a log-scale) with vertex :math:`(x_0, y_0)` + + .. math:: + y = C\cdot (x-x_{0}) + y_0 + + Args: + x (array_like): Input values + c (float): Slope + x0 (float): x position of vertex + y0 (float): y position of vertex + + """ + type = 'Basic' + name = 'Log-Parabola' + equation = 'exp[C*(x-x_{0})^{2} + y_{0}]' + params = ['C', 'x_{0}', 'y_{0}'] + + @staticmethod + def func(x, c, x0, y0): + return np.exp(c * (x-x0)**2 + y0) + + class PowerLawCross: """ Crossover between power laws