### Install pyvisco via pip Source: https://pyvisco.readthedocs.io/en/latest/readme_link.html Install the pyvisco library using pip. Requires Python 3.11 or newer. ```bash pip install pyvisco ``` -------------------------------- ### get_aT(df_raw, RefT) Source: https://pyvisco.readthedocs.io/en/latest/_autosummary/pyvisco.master.html Get shift factors for each temperature level in the raw measurement data. A reference temperature is specified for which the master curve is created, and shift factors are calculated for each measurement set. ```APIDOC ## get_aT(df_raw, RefT) ### Description Get shift factors for each temperature level in the raw measurement data. A reference temperature is specified for which the master curve is created. Measurement sets below the desired reference temperatures are shifted to lower frequencies (longer time periods), whereas measurement sets at temperatures higher than the reference temperature are shifted to higher frequencies (shorter time periods). ### Parameters - **df_raw** (pandas.DataFrame) - Contains the processed raw measurement data. - **RefT** (int or float) - Reference temperature of the master curve in Celsius. ### Returns - **df_aT** (pandas.DataFrame) - Contains the decadic logarithm of the shift factors `log_aT` and the corresponding temperature values `T` in degree Celsius. ``` -------------------------------- ### get_curve(df_raw, df_aT, RefT) Source: https://pyvisco.readthedocs.io/en/latest/_autosummary/pyvisco.master.html Get master curve by shifting the individual measurement sets. This function uses the shift factors to combine measurement data into a master curve. ```APIDOC ## get_curve(df_raw, df_aT, RefT) ### Description Get master curve by shifting the individual measurement sets. ### Parameters - **df_raw** (pandas.DataFrame) - Contains the processed raw measurement data. - **df_aT** (pandas.DataFrame) - Contains the decadic logarithm of the shift factors `log_aT` and the corresponding temperature values `T` in degree Celsius. - **RefT** (int or float) - Reference temperature of the master curve in Celsius. ### Returns - **df_master** (pandas.DataFrame) - The master curve data. ``` -------------------------------- ### prep_prony_ANSYS(df_prony, prony, E_0=None) Source: https://pyvisco.readthedocs.io/en/latest/_autosummary/pyvisco.verify.html Prepares ANSYS Prony series parameters for further processing by adding the instantaneous modulus and frequency range to the dataframe. Returns a dictionary with the ANSYS Prony series parameters in the same format as the Python implementation. ```APIDOC ## prep_prony_ANSYS(df_prony, prony, E_0=None) ### Description Prepare ANSYS Prony series parameters for further processing. The ANSYS curve fitting routine for viscoelastic materials only stores the Prony series parameters (`tau_i`, `alpha_i`) in the material card file. To calculate the master curve from the Prony series parameters the instantenous modulus and frequency range are required and added to the dataframe of the ANSYS Prony series parameters. ### Parameters - **df_prony** (pandas.DataFrame) - Required - Contains the ANSYS Prony series parameter. - **prony** (dict) - Required - Contains the Python Prony series parameter. - **E_0** (float, default = None) - Optional - Instantaneous storage modulus; for either tensile (E_0) or shear (G_0) loading. If E_0 is not provided the instantaneous storage modulus identified during the Python curve fitting process will be used to create the master curve with the ANSYS Prony series parameters. ### Returns - **prony_ANSYS** (dict) - Contains the ANSYS Prony series parameter in the same format as the Python implementation provides (see `prony` Parameter above). ``` -------------------------------- ### prep_prony_ANSYS Source: https://pyvisco.readthedocs.io/en/latest/_sources/_autosummary/pyvisco.verify.rst.txt Prepares Prony series data for ANSYS. This function is part of the pyvisco.verify module. ```APIDOC ## prep_prony_ANSYS ### Description Prepares Prony series data for ANSYS. ### Method Function call ### Signature `prep_prony_ANSYS()` ### Parameters No parameters documented. ### Returns No return value documented. ``` -------------------------------- ### load_prony_ANSYS(filepath) Source: https://pyvisco.readthedocs.io/en/latest/_autosummary/pyvisco.verify.html Loads Prony series parameters from an ANSYS material card file (.MPL). Returns a pandas DataFrame containing the Prony series parameters. ```APIDOC ## load_prony_ANSYS(filepath) ### Description Load Prony series parameters from ANSYS material card file. ### Parameters - **filepath** (str) - Required - Location and file name of ANSYS material card file (.MPL) ### Returns - **df_prony** (pandas.DataFrame) - Contains the Prony series parameter. ``` -------------------------------- ### pyvisco.prony.fit_time(df_dis, df_master, opt=False) Source: https://pyvisco.readthedocs.io/en/latest/_autosummary/pyvisco.prony.html Fits Prony series parameters in the time domain using least-squares minimization with the L-BFGS-B method from scipy. ```APIDOC ## pyvisco.prony.fit_time(df_dis, df_master, opt=False) ### Description Fit Prony series parameter in time domain. A least-squares minimization is performed using the L-BFGS-B method from the scipy package. The implementation is similar to the optimization problem described by [1] for a homogenous distribution of discrete times. ### Parameters - **df_dis** (pandas.DataFrame) - Required - Contains the discrete relaxation times and corresponding data. - **df_master** (pandas.DataFrame) - Required - Contains the master curve data. - **opt** (bool, default=False) - Optional - Flag indicates whether the Prony term minimization routine should be executed or not. ### Returns - **dict** - Contains the Prony series parameters of the fit. ### References [1] Barrientos, E., Pelayo, F., Noriega, Á. et al. Optimal discrete-time Prony series fitting method for viscoelastic materials. Mech Time-Depend Mater 23, 193-206 (2019). https://doi.org/10.1007/s11043-018-9394-z ``` -------------------------------- ### pyvisco.load.user_shift(data_shift) Source: https://pyvisco.readthedocs.io/en/latest/_autosummary/pyvisco.load.html Loads user-provided shift factors from a CSV file. The file must contain two columns: shift factors log_aT and corresponding temperatures T. ```APIDOC ## pyvisco.load.user_shift(data_shift) ### Description Loads user-provided shift factors from a CSV file. The file must contain two columns: one for the shift factors log_aT and one for the corresponding temperatures T. The file header must consist of two rows: the first row provides the name of the physical quantity and the second row provides the corresponding physical unit. Column headers are checked against module conventions. ### Method Function ### Endpoint pyvisco.load.user_shift ### Parameters - **data_shift** (bytes) - Required - CSV file content. ### Returns - **df_aT** (pandas.DataFrame) - Contains the shift factors and corresponding temperatures. ### Raises - **KeyError** - If the file header variable names or units do not follow the conventions used in this module. ### See Also - `load.conventions` - Summarizes conventions for variable names and units. - `load.file` - Returns bytes object to be used as parameter data. - `load.check_units` - Raises KeyError if units don't comply with conventions. ### Notes Example file header: | Row | Header | |-----|--------| | 1 | T, log_aT | | 2 | C, - | Example input files can be found here: (TBD). ``` -------------------------------- ### pyvisco.load.get_units(units, modul, domain, Eplexor=False) Source: https://pyvisco.readthedocs.io/en/latest/_autosummary/pyvisco.load.html Returns the physical units based on the measurement data loading condition (tensile or shear) and domain (time or frequency). ```APIDOC ## pyvisco.load.get_units(units, modul, domain, Eplexor=False) ### Description Gets the physical units based on the measurement data loading condition (tensile or shear) and domain (time or frequency). ### Method Function call ### Endpoint pyvisco.load.get_units ### Parameters #### Function Parameters - **units** (dict of {str : str}) - Required - Contains the names of the physical quantities as key and the corresponding names of the units as item. - **modul** ({'E', 'G'}) - Required - Indicates whether tensile ('E') or shear ('G') modulus data are provided. - **domain** ({'freq', 'time'}) - Required - Defines whether frequency domain ('freq') or time domain ('time') input data are provided. - **Eplexor** (bool, default=False) - Optional - If input file is Excel file from Eplexor software -> True. If input file is CSV file from user instrument -> False. ### Returns - **conv** (dict of {str : str}) - Conventions for physical quantities as key and corresponding units as items for the provided measurement loading conditions and domain. ``` -------------------------------- ### pyvisco.load.user_raw(data, domain, modul) Source: https://pyvisco.readthedocs.io/en/latest/_autosummary/pyvisco.load.html Loads raw measurement data from a CSV file. This function accepts tensile or shear modulus data from frequency or time domain characterizations, checks column headers against conventions, and returns processed data. ```APIDOC ## pyvisco.load.user_raw(data, domain, modul) ### Description Loads raw measurement data from a CSV file. This function accepts tensile or shear modulus data from frequency or time domain characterizations, checks column headers against conventions, and returns processed data. ### Method Function call ### Endpoint pyvisco.load.user_raw(data, domain, modul) ### Parameters - **data** (bytes) - Required - Excel file content. - **domain** ({'freq', 'time'}) - Required - Defines whether frequency domain (`freq`) or time domain (`time`) input data are provided. - **modul** ({'E', 'G'}) - Required - Indicates whether tensile (`E`) or shear (`G`) modulus data are provided. ### Returns - **df_raw** (pandas.DataFrame) - Contains the preprocessed raw measurement data. - **arr_RefT** (pandas.Series) - Contains the temperature levels of the measurement sets. - **units** (dict of {str : str}) - Contains the names of the physical quantities as key and the corresponding names of the units as item. ### Raises - **KeyError** - If the file header variable names or units do not follow the conventions used in this module. ### See Also - `load.conventions` - Summarizes conventions for variable names and units. - `load.file` - Returns bytes object to be used as parameter data. - `load.check_units` - Raises KeyError if units don’t comply with conventions. ### Notes Dependent on the performed material characterization, either tensile or shear modulus values in either the time or frequency domain must be provided. Tensile moduli are denoted as `E` and shear moduli are denoted as `G`. Frequency domain data are provided in Hertz: [f] = Hz. Time domain data are provided in seconds: [t] = s. Temperature levels are provided in Celsius: [T] = C. Measurement set identifiers are provided by the column Set. In Set, all measurement points at the same temperature level are marked with the same number, e.g. 0, for the first measurement set. The first measurement Set (0) represents the coldest temperature followed by the second set (1) at the next higher temperature level and so forth. Example input files can be found here: (TBD) Various examples for file headers: | Domain | Row | Tensile Modulus | Shear Modulus | |---|---|---|---| | Frequency | 1 | f, E_stor, E_loss, T, Set | f, G_stor, G_loss, T, Set | | Frequency | 2 | Hz, MPa, MPa, C, - | Hz, GPa, GPa, C, - | | Time | 1 | t, E_relax, T, Set | t, G_relax, T, Set | | Time | 2 | s, MPa, C, - | s, GPa, C, - | ``` -------------------------------- ### pyvisco.load Functions Source: https://pyvisco.readthedocs.io/en/latest/_sources/_autosummary/pyvisco.load.rst.txt The pyvisco.load module provides a collection of functions for loading and preparing viscoelastic data. These functions handle file reading, unit checking, and data preprocessing for various formats. ```APIDOC ## pyvisco.load Functions ### Description This module provides functions for loading and preparing viscoelastic data from various sources. ### Functions - **Eplexor_master** - Loads master data from Eplexor instrument. - **Eplexor_raw** - Loads raw data from Eplexor instrument. - **check_units** - Checks and validates units in the data. - **conventions** - Applies naming conventions to the data. - **file** - Loads data from a file. - **get_sets** - Retrieves data sets. - **get_units** - Retrieves units from the data. - **prep_csv** - Prepares CSV data for analysis. - **prep_excel** - Prepares Excel data for analysis. - **user_master** - Loads user-provided master data. - **user_raw** - Loads user-provided raw data. - **user_shift** - Applies user-defined shifts to the data. ``` -------------------------------- ### conventions(modul) Source: https://pyvisco.readthedocs.io/en/latest/_autosummary/pyvisco.load.html Create dictionary with unit conventions for expected physical quantities. The modul parameter indicates whether tensile ('E') or shear ('G') modulus data are provided. ```APIDOC ## conventions(modul) ### Description Create dictionary with unit conventions for expected physical quantities. The modul parameter indicates whether tensile ('E') or shear ('G') modulus data are provided. ### Parameters - **modul** ({'E', 'G'}) - Required - Indicates whether tensile (`E`) or shear (`G`) modulus data are provided. ### Returns - **conv** (dict of {str : str}) - Contains the names of the physical quantities as key and the corresponding names of the units as item. ### Notes Tensile moduli are denoted as `E` and shear moduli are denoted as `G`. Only the tensile moduli are summarized in the table below. For shear modulus data, replace `E` with `G`, e.g. `E_relax` -> `G_relax`. Physical quantity | Variable | Unit ---|---|--- Relaxation modulus: | E_relax | [Pa, kPa, MPa, GPa] Storage modulus: | E_stor | [Pa, kPa, MPa, GPa] Loss modulus: | E_loss | [Pa, kPa, MPa, GPa] Complex modulus: | E_comp | [Pa, kPa, MPa, GPa] Loss factor: | tan_del | `-` Instantaneous modulus: | E_0 | [Pa, kPa, MPa, GPa] Equilibrium modulus: | E_inf | [Pa, kPa, MPa, GPa] Angular frequency: | omega | rad/s Frequency: | f | Hz Time: | t | s Temperature: | T | °C Relaxation times: | tau_i | s Relaxation moduli: | E_i | [Pa, kPa, MPa, GPa] Norm. relaxation moduli: | alpha_i | `-` Shift factor: | log_aT | `-` ``` -------------------------------- ### pyvisco.prony.GMaxw_temp(shift_func, df_GMaxw, df_coeff, df_aT, freq=None) Source: https://pyvisco.readthedocs.io/en/latest/_autosummary/pyvisco.prony.html Calculates the Generalized Maxwell model for different loading frequencies and temperatures using a specified shift function. ```APIDOC ## pyvisco.prony.GMaxw_temp(shift_func, df_GMaxw, df_coeff, df_aT, freq=None) ### Description Calculate Gen. Maxwell model for different loading frequencies and temperatures. This function showcases the temperature and rate-dependence of the visco-elastic material. The specified shift function is used to calculate the material response at different temperatures and different loading rates. ### Parameters - **shift_func** - Required - The shift function to be used. - **df_GMaxw** - Required - DataFrame containing Generalized Maxwell model data. - **df_coeff** - Required - DataFrame containing coefficients. - **df_aT** - Required - DataFrame containing shift factors. - **freq** (optional) - Optional - Frequency values. ### Returns - Not specified in the source. ``` -------------------------------- ### pyvisco.shift.fit_WLF Source: https://pyvisco.readthedocs.io/en/latest/_autosummary/pyvisco.shift.html Fits the WLF equation to experimental shift factor data and returns the fitted parameters. ```APIDOC ## pyvisco.shift.fit_WLF(RefT, df_aT) ### Description Fit the Williams-Landel-Ferry (WLF) equation to a set of shift factors. ### Parameters - **RefT** (numeric) - Reference temperature chosen to construct the master curve. - **df_aT** (pandas.DataFrame) - Contains the decadic logarithm of the shift factors `log_aT` and the corresponding temperature values `T` in degree Celsius. ### Returns - **df** (pandas.DataFrame) - Contains the necessary parameters to calculate the WLF equation (RefT, WLF_C1, WLF_C2). ``` -------------------------------- ### nprony(df_master, prony_series, window='min', opt=1.5) Source: https://pyvisco.readthedocs.io/en/latest/_autosummary/pyvisco.opt.html Minimizes the number of Prony terms used in the Generalized Maxwell model. The number of Prony terms is gradually decreased and the new Prony series parameters are identified. The goodness of fit is evaluated based on the R^2 measure, and an optimal number of Prony terms is suggested. ```APIDOC ## nprony(df_master, prony_series, window='min', opt=1.5) ### Description Minimize number of Prony terms used in Generalized Maxwell model. The number of Prony terms is gradually decreased and the new Prony series parameters are identified. The goodness of fit is evaluated based on the R^2 measure. An optimal number of Prony terms is suggested. ### Parameters - **df_master** (pandas.DataFrame) - Required - Contains the master curve data. - **prony_series** (dict) - Required - Contains the Prony series parameters of the initial fit. - **window** ({'min', 'round', 'exact'}) - Optional - Defines the location of the discretization of the relaxation times. 'exact': use whole window of the experimental data and logarithmically space the relaxation times between; 'round': round the minimum and maximum values of the experimental data to the nearest base 10 number and logarithmically space the remaining relaxation times between the rounded numbers; 'min': Position of relaxation times is optimized during minimization routine to reduce the number of Prony terms. - **opt** (numeric) - Optional - Multiplier for the inital least squares residual to suggest an optimal number of Prony terms: (R_opt)^2 = opt * (R_0)^2. ### Returns - **dict_prony** (dict{N : prony_series}) - Contains all prony_series parameters for each number of calculated Prony terms, N. - **N_opt** (int) - Optimal number of Prony terms. - **err** (pandas.DataFrame) - Contains the least sqare residuals for each calculated Prony series. ``` -------------------------------- ### file(path) Source: https://pyvisco.readthedocs.io/en/latest/_autosummary/pyvisco.load.html Read data from file. The path parameter accepts various path formats and returns the file content as bytes. ```APIDOC ## file(path) ### Description Read data from file. The path parameter accepts various path formats and returns the file content as bytes. ### Parameters - **path** (str or os.PathLike) - Required - Filepath to the file that is being read. Forward, back, and mixed slashes are all accepted. Surrounding whitespace and a matched pair of surrounding quotes are stripped before opening so that paths copy-pasted from Windows Explorer / PowerShell (“Copy as path”, which wraps the result in double quotes) work out of the box. ### Returns - **data** (bytes) - File content. ### Raises - **FileNotFoundError** - If the (sanitized) path does not point to an existing file. The error message includes the path that was actually attempted to aid debugging when the input contained copy-paste artefacts. ### Notes This function is included to simplify the file upload within the interactive module where graphical dashboards are hosted on a webserver. ``` -------------------------------- ### pyvisco.shift.WLF Source: https://pyvisco.readthedocs.io/en/latest/_autosummary/pyvisco.shift.html Calculates the Williams-Landel-Ferry (WLF) shift factor for a given temperature and reference temperature. ```APIDOC ## pyvisco.shift.WLF(Temp, RefT, WLF_C1, WLF_C2) ### Description Calculate the Williams-Landel-Ferry (WLF) equation to determine the shift factor for time-temperature superposition. ### Parameters - **Temp** (numeric) - Evaluation temperature of the shift factor. - **RefT** (numeric) - Reference temperature chosen to construct the master curve. - **WLF_C1** (numeric) - Empirical constants (obtained from fitting the shift factor a_T). - **WLF_C2** (numeric) - Empirical constants (obtained from fitting the shift factor a_T). ### Returns - **log_aT** (numeric) - The decadic logarithm of the WLF shift factor. ``` -------------------------------- ### prep_excel(data) Source: https://pyvisco.readthedocs.io/en/latest/_autosummary/pyvisco.load.html Load Excel files into pandas dataframe and prepare data. The function removes NANs from the input data, and identifies the names of the physical quantities and units from the file header. ```APIDOC ## prep_excel(data) ### Description Load Excel files into pandas dataframe and prepare data. The function removes NANs from the input data, and identifies the names of the physical quantities and units from the file header. The file header must consist of two rows. The first row provides the name of the physical quantity and the second row provides the corresponding physical unit. ### Parameters - **data** (bytes) - Required - Excel file content to be loaded into a pandas.DataFrame. ### Returns - **df** (pandas.DataFrame) - Contains the Excel file data. - **units** (dict of {str : str}) - Contains the names of the physical quantities as key and the corresponding names of the units as item. ### See also - `load.file` - Returns bytes object to be used as input parameter data. ``` -------------------------------- ### pyvisco.shift.WLF() Source: https://pyvisco.readthedocs.io/en/latest/_autosummary/pyvisco.shift.html Calculates shift factors using the WLF equation. Returns a dataframe with the decadic logarithm of shift factors and temperature values. ```APIDOC ## pyvisco.shift.WLF() ### Description Calculates shift factors using the WLF equation. ### Method Function call ### Endpoint pyvisco.shift.WLF() ### Parameters No parameters documented. ### Returns - **df_aT** (pandas.DataFrame) – Contains the decadic logarithm of the shift factors `log_aT` and the corresponding temperature values `T` in degree Celsius. ``` -------------------------------- ### pyvisco.shift.poly1() Source: https://pyvisco.readthedocs.io/en/latest/_autosummary/pyvisco.shift.html Calculates shift factors using a first-degree polynomial shift function. ```APIDOC ## pyvisco.shift.poly1() ### Description Calculates shift factors using a first-degree polynomial shift function. ### Method Function call ### Endpoint pyvisco.shift.poly1() ### Parameters No parameters documented. ### Returns - **df_aT** (pandas.DataFrame) – Contains the decadic logarithm of the shift factors `log_aT` and the corresponding temperature values `T` in degree Celsius. ``` -------------------------------- ### pyvisco.shift Functions Source: https://pyvisco.readthedocs.io/en/latest/_sources/_autosummary/pyvisco.shift.rst.txt The pyvisco.shift module provides functions for shift factor analysis, including WLF equation fitting, polynomial fitting, and plotting utilities. ```APIDOC ## pyvisco.shift Functions ### Description This module provides functions for time-temperature superposition (shift) analysis, including WLF fitting, polynomial fitting, and plotting. ### Functions - **WLF** - Fits the Williams-Landel-Ferry (WLF) equation to shift factors. - **fit_WLF** - Fits the WLF equation to experimental shift factor data. - **fit_poly** - Fits a polynomial to shift factor data. - **plot** - Plots shift factor data and fitted curves. - **poly1** - Polynomial of degree 1 for shift factor fitting. - **poly2** - Polynomial of degree 2 for shift factor fitting. - **poly3** - Polynomial of degree 3 for shift factor fitting. - **poly4** - Polynomial of degree 4 for shift factor fitting. ### Usage These functions are called directly by users to perform shift factor analysis. Refer to the individual function documentation for detailed parameters and return values. ``` -------------------------------- ### pyvisco.prony.fit_freq(df_dis, df_master, opt=False) Source: https://pyvisco.readthedocs.io/en/latest/_autosummary/pyvisco.prony.html Fits Prony series parameters in the frequency domain using least-squares minimization with the L-BFGS-B method from scipy. ```APIDOC ## pyvisco.prony.fit_freq(df_dis, df_master, opt=False) ### Description Fit Prony series parameter in frequency domain. A least-squares minimization is performed using the L-BFGS-B method from the scipy package. The implementation is similar to the optimization problem described by [1] for a homogenous distribution of discrete times. ### Parameters - **df_dis** (pandas.DataFrame) - Required - Contains the discrete relaxation times and corresponding data. - **df_master** (pandas.DataFrame) - Required - Contains the master curve data. - **opt** (bool, default=False) - Optional - Flag indicates whether the Prony term minimization routine should be executed or not. ### Returns - **dict** - Contains the Prony series parameters of the fit. ### References [1] Barrientos, E., Pelayo, F., Noriega, Á. et al. Optimal discrete-time Prony series fitting method for viscoelastic materials. Mech Time-Depend Mater 23, 193-206 (2019). https://doi.org/10.1007/s11043-018-9394-z ``` -------------------------------- ### pyvisco.shift.fit_WLF() Source: https://pyvisco.readthedocs.io/en/latest/_autosummary/pyvisco.shift.html Fits the WLF equation to shift factor data. ```APIDOC ## pyvisco.shift.fit_WLF() ### Description Fits the WLF equation to shift factor data. ### Method Function call ### Endpoint pyvisco.shift.fit_WLF() ### Parameters No parameters documented. ### Returns - **df_WLF** (pandas.DataFrame) – Contains the necessary parameters to calculate the WLF equation (RefT, WLF_C1, WLF_C2) in degree Celsius. ``` -------------------------------- ### pyvisco.load.check_units(units, modul='E') Source: https://pyvisco.readthedocs.io/en/latest/_autosummary/pyvisco.load.html Checks that the input file units conform with the conventions used in this module. Raises KeyError if the file header variable names or units do not follow the conventions. ```APIDOC ## pyvisco.load.check_units(units, modul='E') ### Description Checks that the input file units conform with the conventions used in this module. The input units are compared against the conventions used for the measurement loading conditions and domain. For frequency domain data, the storage and loss modulus values must have the same unit. ### Method Function call ### Endpoint pyvisco.load.check_units ### Parameters #### Function Parameters - **units** (dict of {str : str}) - Required - Contains the names of the physical quantities as key and the corresponding names of the units as item. - **modul** ({'E', 'G'}) - Optional - Indicates whether tensile ('E') or shear ('G') modulus data are provided. Default is 'E'. ### Raises - **KeyError** - If the file header variable names or units do not follow the conventions used in this module. ``` -------------------------------- ### fit_at_pwr(df_raw, gb_ref, gb_shift) Source: https://pyvisco.readthedocs.io/en/latest/_autosummary/pyvisco.master.html Obtain shift factor between two measurement sets at different temperatures. The raw measurement data at each temperature level are fitted by a Power Law function to improve robustness, and the intersection of the functions is used to obtain the shift factor. ```APIDOC ## fit_at_pwr(df_raw, gb_ref, gb_shift) ### Description Obtain shift factor between two measurement sets at different temperatures. The raw measurement data at each temperature level are fitted by a Power Law function. These Power Law functions improve the robustness of the shifting algorithm, because they smooth outliers and bridge possible gaps between the data sets. The intersection of the functions is calculated and used to obtain the shift factor. ### Parameters - **df_raw** (pandas.DataFrame) - Contains the processed raw measurement data. - **gb_ref** (int) - Dataframe `Set` number of the reference measurement set. - **gb_shift** (int) - Dataframe `Set` number of the measurement set that is shifted. ### Returns - **log_aT** (numeric) - The decadic logarithm of the shift factor between the two measurement sets. ### Notes In certain circumstances the equilibration time between measurements at different temperature levels can be too short to reach a steady state leading to errors in the first data point of the measurement set. To account for such situation, two Power law fits are conducted. The first fit contains all data points and the second fit drops the first data point. If dropping the data point increased the goodness of fit, this Power Law fit is used to calculate the shift factor. ``` -------------------------------- ### prep_csv(data) Source: https://pyvisco.readthedocs.io/en/latest/_autosummary/pyvisco.load.html Load csv files into pandas dataframe and prepare data. The function removes NANs from the input data, and identifies the names of the physical quantities and units from the file header. ```APIDOC ## prep_csv(data) ### Description Load csv files into pandas dataframe and prepare data. The function removes NANs from the input data, and identifies the names of the physical quantities and units from the file header. The file header must consist of two rows. The first row provides the name of the physical quantity and the second row provides the corresponding physical unit. ### Parameters - **data** (bytes) - Required - CSV file content to be loaded into a pandas.DataFrame. ### Returns - **df** (pandas.DataFrame) - Contains the csv file data. - **units** (dict of {str : str}) - Contains the names of the physical quantities as key and the corresponding names of the units as item. ### See also - `load.file` - Returns bytes object to be used as input parameter data. ``` -------------------------------- ### pyvisco.load.user_master(data, domain, RefT, modul) Source: https://pyvisco.readthedocs.io/en/latest/_autosummary/pyvisco.load.html Loads master curve data from a CSV file. Accepts tensile or shear modulus data in frequency or time domain. ```APIDOC ## pyvisco.load.user_master(data, domain, RefT, modul) ### Description Loads master curve data from a CSV file. The file header must consist of two rows: the first row provides the name of the physical quantity and the second row provides the corresponding physical unit. Column headers are checked against module conventions. ### Method Function ### Endpoint pyvisco.load.user_master ### Parameters - **data** (bytes) - Required - CSV file content. - **domain** ({'freq', 'time'}) - Required - Defines whether frequency domain ('freq') or time domain ('time') input data are provided. - **RefT** (int or float) - Required - Reference temperature of the master curve in Celsius. - **modul** ({'E', 'G'}) - Required - Indicates whether tensile ('E') or shear ('G') modulus data are provided. ### Returns - **df_master** (pandas.DataFrame) - Contains the master curve data. - **units** (dict of {str: str}) - Contains the names of the physical quantities as key and the corresponding names of the units as item. ### Raises - **KeyError** - If the file header variable names or units do not follow the conventions used in this module. ### See Also - `load.conventions` - Summarizes conventions for variable names and units. - `load.file` - Returns bytes object to be used as parameter data. - `load.check_units` - Raises KeyError if units don't comply with conventions. ### Notes Dependent on the performed materials characterization, either tensile or shear modulus values in either the time or frequency domain must be provided. Tensile moduli are denoted as `E` and shear moduli as `G`. Frequency domain data are provided in Hertz: [f] = Hz. Time domain data are provided in seconds: [t] = s. Example input files can be found here: (TBD). Various examples for file headers: | Domain | Row | Tensile Modulus | Shear Modulus | |--------|-----|-----------------|---------------| | Frequency | 1 | f, E_stor, E_loss | f, G_stor, G_loss | | Frequency | 2 | Hz, MPa, MPa | Hz, GPa, GPa | | Time | 1 | t, E_relax | t, G_relax | | Time | 2 | s, MPa | s, GPa | ``` -------------------------------- ### BibTeX citation for pyvisco Source: https://pyvisco.readthedocs.io/en/latest/readme_link.html BibTeX entry for citing pyvisco, with placeholders for DOI and version. ```bibtex @software{Springer_pyvisco_2022, author = {Springer, Martin}, doi = {insert DOI}, title = {{PYVISCO: A Python library for identifying Prony series parameters of linear viscoelastic materials}}, url = {https://github.com/NatLabRockies/pyvisco}, version = {insert version}, year = {2022} } ``` -------------------------------- ### pyvisco.prony Functions Source: https://pyvisco.readthedocs.io/en/latest/_sources/_autosummary/pyvisco.prony.rst.txt A list of functions available in the pyvisco.prony module for Prony series analysis, including normalization, discretization, fitting, and plotting. ```APIDOC ## pyvisco.prony Functions ### Description This module provides functions for Prony series analysis, including normalization, discretization, fitting, and plotting. ### Functions - **E_freq_norm** - Normalize frequency-domain modulus. - **E_relax_norm** - Normalize relaxation modulus. - **GMaxw_temp** - Compute Maxwell model shear modulus as a function of temperature. - **calc_GMaxw** - Calculate Maxwell model shear modulus. - **discretize** - Discretize the Prony series. - **fit** - Fit Prony series to data. - **fit_freq** - Fit Prony series to frequency-domain data. - **fit_time** - Fit Prony series to time-domain data. - **ls_res** - Compute least-squares residuals. - **plot_GMaxw** - Plot Maxwell model shear modulus. - **plot_GMaxw_temp** - Plot Maxwell model shear modulus vs temperature. - **plot_dis** - Plot discretization results. - **plot_fit** - Plot fitting results. - **plot_param** - Plot parameters. - **split_x0** - Split initial guess vector. ``` -------------------------------- ### pyvisco.shift.poly2() Source: https://pyvisco.readthedocs.io/en/latest/_autosummary/pyvisco.shift.html Calculates shift factors using a second-degree polynomial shift function. ```APIDOC ## pyvisco.shift.poly2() ### Description Calculates shift factors using a second-degree polynomial shift function. ### Method Function call ### Endpoint pyvisco.shift.poly2() ### Parameters No parameters documented. ### Returns - **df_aT** (pandas.DataFrame) – Contains the decadic logarithm of the shift factors `log_aT` and the corresponding temperature values `T` in degree Celsius. ``` -------------------------------- ### pyvisco.load.Eplexor_master(data, modul) Source: https://pyvisco.readthedocs.io/en/latest/_autosummary/pyvisco.load.html Loads master curve data from an EPLEXOR Excel file. Extracts modulus data, shift factors, and WLF shift function parameters. ```APIDOC ## pyvisco.load.Eplexor_master(data, modul) ### Description Loads master curve data from an EPLEXOR Excel file. The file must be created using the Excel Export! feature of the EPLEXOR software with the default template. Column headers are renamed to follow module conventions, and physical quantities and units are checked. ### Method Function ### Endpoint pyvisco.load.Eplexor_master ### Parameters - **data** (bytes) - Required - Excel file content. - **modul** ({'E', 'G'}) - Required - Indicates whether tensile ('E') or shear ('G') modulus data are provided. ### Returns - **df_master** (pandas.DataFrame) - Contains the master curve data. - **df_aT** (pandas.DataFrame) - Contains the shift factors. - **df_WLF** (pandas.DataFrame) - Contains the WLF shift function parameters. - **units** (dict of {str: str}) - Contains the names of the physical quantities as key and the corresponding names of the units as item. ### Raises - **KeyError** - If the file header variable names or units do not follow the conventions used in this module. ### See Also - `load.conventions` - Summarizes conventions for variable names and units. - `load.file` - Returns bytes object to be used as parameter data. - `load.check_units` - Raises KeyError if units don't comply with conventions. ``` -------------------------------- ### pyvisco.load.Eplexor_raw(data, modul) Source: https://pyvisco.readthedocs.io/en/latest/_autosummary/pyvisco.load.html Loads raw measurement data from an EPLEXOR Excel file. This function processes DMTA data from a Netzsch Gabo DMA EPLEXOR, renames column headers, checks units, and groups measurements into data sets based on frequency range. ```APIDOC ## pyvisco.load.Eplexor_raw(data, modul) ### Description Loads raw measurement data from an EPLEXOR Excel file. This function processes DMTA data from a Netzsch Gabo DMA EPLEXOR, renames column headers, checks units, and groups measurements into data sets based on frequency range. ### Method Function call ### Endpoint pyvisco.load.Eplexor_raw(data, modul) ### Parameters - **data** (bytes) - Required - Excel file content loaded into pandas.DataFrame. - **modul** ({'E', 'G'}) - Required - Indicates whether tensile (`E`) or shear (`G`) modulus data are provided. ### Returns - **df_raw** (pandas.DataFrame) - Contains the processed raw measurement data. - **arr_RefT** (pandas.Series) - Contains the temperature levels of the measurement sets. - **units** (dict of {str : str}) - Contains the names of the physical quantities as key and the corresponding names of the units as item. ### Raises - **KeyError** - If the file header variable names or units do not follow the conventions used in this module. ### See Also - `load.conventions` - Summarizes conventions for variable names and units. - `load.file` - Returns bytes object to be used as parameter data. - `load.check_units` - Raises KeyError if units don’t comply with conventions. ``` -------------------------------- ### pyvisco.prony.calc_GMaxw(E_0, df_terms, f_min, f_max, decades, modul, **kwargs) Source: https://pyvisco.readthedocs.io/en/latest/_autosummary/pyvisco.prony.html Calculates the Generalized Maxwell model data from the Prony series parameters. ```APIDOC ## pyvisco.prony.calc_GMaxw(E_0, df_terms, f_min, f_max, decades, modul, **kwargs) ### Description Calculate the Generalized Maxwell model data from the Prony series parameter. ### Parameters - **E_0** (numeric) - Required - Instantaneous storage modulus. Same variable name is used for either tensile (E_0) or shear (G_0) loading. - **df_terms** (pandas.DataFrame) - Required - Contains the Prony series parameters tau_i and alpha_i. - **f_min** (numeric) - Required - Lower bound frequency for calculation of physical quantities. - **f_max** (numeric) - Required - Upper bound frequency for calculation of physical quantities. - **decades** (integer) - Required - Number of decades spanning the frequency window. Is used to calculate the necessary number of data points spanning the frequency range for an appropriate resolution. - **modul** ({'E','G'}) - Required - Indicates whether tensile (E) or shear (G) modulus data are provided. - **kwargs** - Optional - Additional keyword arguments. ### Returns - **pandas.DataFrame** - Contains the calculated Generalized Maxwell model data for the fitted Prony series parameters with the specified boundaries and parameters. ```