HN derivative Module — HavNegpy 1.1 documentation

# HN derivative Module

## `HN_derivative class`

class HavNegpy.HN_derivative

  A class to analyze the derivaite of real part of complex permittivity with derivative HN function

  Fit functions include single, double, and derivative HN with electrode polarization

## `HavNegpy.HN_derivative fit functions`

HN_derivative.deri_hn(x, b, g, fm, deps)

  derivaitive HN fit function to fit single peak

  Parameters

    - x (float) – frequency.

    - b (float) – symmetric fractional parameter.

    - g (float) – asymmetric fractional parameter.

    - fm (float) – maximum frequency of the peak.

    - deps (float) – dielectric strength.

  Returns

    y – estimated log derivative of epsilon’ based on the supplied parameters.

  Return type

    array

HN_derivative.deri_hn_ep(x, b, g, fm, deps, A, l)

  derivaitive HN fit function to fit single peak along with electrode polarization(ep)

  Parameters

    - x (float) – frequency.

    - b (float) – symmetric fractional parameter.

    - g (float) – asymmetric fractional parameter.

    - fm (float) – maximum frequency of the loss peak.

    - deps (float) – dielectric strength.

    - A (float) – electrode polarization value.

    - l (float) – power law exponent.

  Returns

    y – estimated log derivative of epsilon’ based on the supplied parameters.

  Return type

    array

HN_derivative.deri_double_hn(x, b1, g1, fm1, deps1, b2, g2, fm2, deps2)

  derivaitive HN fit function to fit two peaks

  Parameters

    - x (float) – frequency.

    - b1 (float) – symmetric fractional parameter of the 1st peak.

    - g1 (float) – asymmetric fractional parameter of the 1st peak.

    - fm1 (float) – maximum frequency of the 1st peak.

    - deps1 (float) – dielectric strength of the 1st peak.

    - b2 (float) – symmetric fractional parameter of the 2nd peak.

    - g2 (float) – asymmetric fractional parameter of the 2nd peak.

    - fm2 (float) – maximum frequency of the 2nd peak.

    - deps2 (float) – dielectric strength of the 2nd peak.

  Returns

    y – estimated log derivative of epsilon’ based on the supplied parameters.

  Return type

    array

HN_derivative.ep_s(x, A, l)

  Function to estimate the electrode polarization(EP) contribution from the total fit

  While fitting, the deconvoluted EP is based on this function.

  Parameters

    - x (float) – frequency.

    - A (float) – electrode polarization value.

    - l (float) – power law exponent.

  Returns

    y – estimated log EP.

  Return type

    array

## `HavNegpy.HN_derivative dump methods`

HN_derivative.dump_parameters_deri_hn()

  dumps the initial fit parameters for derivative hn function as a dictionary in a json file to load it during curve fitting

  Returns

  Return type

    None

HN_derivative.dump_parameters_deri_double_hn()

  dumps the initial fit parameters for derivative_double hn function as a dictionary in a json file to load it during curve fitting

  Returns

  Return type

    None

## `HavNegpy.HN_derivative initial view methods`

HN_derivative.initial_view_deri_hn(x, y)

  plots the derivative hn function based on the initial parameters given via the dump_parameters method

  Parameters

    - x (array) – log frequency.

    - y (array) – log derivative of epsilon’.

  Returns

  Return type

    None.

HN_derivative.initial_view_deri_hn_ep(x, y)

  plots the derivative hn function with electrode polarization based on the initial parameters given via the dump_parameters method

  Parameters

    - x (array) – log frequency.

    - y (array) – log derivative of epsilon’.

  Returns

  Return type

    None.

HN_derivative.initial_view_deri_double_hn(x, y)

  plots the derivative double hn function based on the initial parameters given via the dump_parameters method

  Parameters

    - x (array) – log frequency.

    - y (array) – log derivative of epsilon’.

  Returns

  Return type

    None.

## `HavNegpy.HN_derivaitve methods for fitting and saving the fit results`

HN_derivative.create_analysis_file()

  > Creates a file to save the fit results based on the choice of fit function

  > Provides option to use an existing file and creates a new file if not found

  Returns

  Return type

    None.

HN_derivative.select_range(x, y)

  Selects the region of interest to fit data using mplcursors allows two clicks to select the lower and upper bound of the x-axis and returns the selected x and y vaues for fitting

  Returns

    - x1 (array) – log frequency

    - y1 (array) – log dielectric loss

HN_derivative.fit(x, y)

  Fits the derivaitve of epsilon’ data with choice of fit function The fit parameters are declared as global variables to be saved via save_fit function

  The initial fit parameters are taken from json file and the final fit parameters are dumped in the same json file to be used for next iteration.

  Parameters

    - x (array) – log frequency.

    - y (array) – log dielectric loss.

  Returns

    fit_par – dictionary containing the fit parameters.

  Return type

    dictionary

HN_derivative.save_fit_deri_hn(T)

  saves the fit parameters of derivative hn function in a file the file must be created via create_analysis_file function

  Parameters

    T (float) – Temperature,or can also be an integer that corresponds to a file number during analysis.

  Returns

  Return type

    None.

HN_derivative.save_fit_deri_hn_ep(T)

  saves the fit parameters of derivaitve hn function with electrode polarization in a file, the file must be created via create_analysis_file function

  Parameters

    T (float) – Temperature,or can also be an integer that corresponds to a file number during analysis.

  Returns

  Return type

    None.

HN_derivative.save_fit_deri_double_HN(T)

  saves the fit parameters of derivaitve double hn function in a file, the file must be created via create_analysis_file function

  Parameters

    T (float) – Temperature,or can also be an integer that corresponds to a file number during analysis.

  Returns

  Return type

    None.