Modulus Module — HavNegpy 1.1 documentation

# Modulus Module

## `Modulus class`

class HavNegpy.Modulus

  A class to analyze real part of complex conductivity

## `HavNegpy.Modulus fit function`

Modulus.modulus_function(x, b, mm, fm)

  Strechted exponential modulus function to fit the electrical modulus data

  Parameters

    - x (float) – log frequency

    - b (float) – strechted exponent

    - mm (float) – Modulus maximum

    - fm (float) – frequency maximum

  Returns

    y – estimated log conductivity based on supplied parameters.

  Return type

    array

## `HavNegpy.Modulus dump methods`

Modulus.dump_parameters()

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

  Returns

  Return type

    None

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

Modulus.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.

Modulus.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 real part of complex conductivity

Modulus.fit(x, y)

  Fits the conductivity 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 conductivity.

  Returns

  Return type

    None.

Modulus.save_fit(T)

  saves the fit parameters of fit 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.