rdmc.mathlib.curvefit#

A module used to fit curves or surfaces. Potentially useful in characterize PES.

class rdmc.mathlib.curvefit.FourierSeries1D(max_num_term: int = None, verbose: bool = False)#

Bases: object

FourierSeries1D helps to fit the potential energy surface to a 1D Fourier Series, and evaluate the values using the fitted curve.

fit(X: ndarray, y: ndarray)#

Fit the 1D Fourier series.

Parameters:
  • X (np.ndarray) – _description_

  • y (np.ndarray) – 1D array. It is assumed to be a periodic function of x with a periodicity of \(2 \pi\).

max_num_term = None#
predict(X: ndarray)#

Predict the value using Fourier Series. This function forces y=0 at the origin.

Parameters:

X (np.ndarray) – The X variable that should be a 1D array.

Returns:

_type_ – _description_