pyvisco.prony¶
Collection of function to pre-process the master curve and perform the Prony series parameter identification.
Functions
|
Calculate normalized storage and loss modulus values. |
|
Calculate normalized relaxation modulus values. |
|
Calculate Gen. |
|
Calculate the Generalized Maxwell model data from the Prony series parameter. |
|
Discretizes relaxation times over time or frequency axis. |
|
Generalized function to call the domain dependent curve fitting routine. |
|
Fit Prony series parameter in frequency domain. |
|
Fit Prony series parameter in time domain. |
|
Wrapper function that calculates the least squares residual. |
|
Plot Generalized Maxwell model data for the reference temperature. |
|
Plot Generalized Maxwell model data for varies temperature and frequencies. |
|
Plot relaxation times on top of master curve. |
|
Plot the master curve and corresponding Prony fit (Gen. |
|
Plot illustrating the Prony series parameters of one or more fits. |
|
Wrapper that splits array x0 of the minimization routine into two arrays. |
- pyvisco.prony.discretize(df_master, window='round', nprony=0)¶
Discretizes relaxation times over time or frequency axis.
Discrete relaxation times are required for Prony parameter curve fitting routine. This function spaces the relaxation times over the experimental characterization window.
- Parameters:
df_master (pandas.DataFrame) – Contains the master curve data.
window ({'round', 'exact', 'min'}) – Defines the location of the discretization of the relaxation times. -
exact: Use whole window of the experimental data and logarithmically space the relaxation times inbetween. -round: Round the minimum and maximum values of the experimental data to the nearest base 10 number and logarithmically space the remaining relaxation times inbetween the rounded numbers -min: Position of relaxation times is optimized during minimization routine to reduce the number of Prony terms.nprony (numeric, default = 0) – Number of Prony terms to be used for the discretization. The number of Prony terms and the number of relaxation times is equal. If no number or 0 is specified, the default behavior of one Prony term per decade is used to automatically calculate the number of Prony terms.
- Returns:
df_dis – Contains discrete point, equal to the relaxation times, of the master curve data (df_master).
- Return type:
pandas.DataFrame
References
Kraus, M. A., and M. Niederwald. “Generalized collocation method using Stiffness matrices in the context of the Theory of Linear viscoelasticity (GUSTL).” Technische Mechanik-European Journal of Engineering Mechanics 37.1 (2017): 82-106.
- pyvisco.prony.plot_dis(df_master, df_dis, units)¶
Plot relaxation times on top of master curve.
- Parameters:
df_master (pandas.DataFrame) – Contains the master curve data.
df_dis (pandas.DataFrame) – Contains the discrete relaxation times and corresponding data.
units (dict of {str : str}) – Contains the names of the physical quantities as key and the corresponding names of the units as item.
- Returns:
fig – Plot showing the relaxation times on top of the master curve.
- Return type:
matplotlib.pyplot.figure
- pyvisco.prony.ls_res(func)¶
Wrapper function that calculates the least squares residual.
- Parameters:
func (function) – Time domain: prony.E_relax_norm Frequency domain: prony.E_freq_norm
- Returns:
residual – Calculates least squares residual for specified domain.
- Return type:
function
- pyvisco.prony.split_x0(func)¶
Wrapper that splits array x0 of the minimization routine into two arrays.
Splits the the first argument x0 into two arrays alpha_i and tau_i and forwards both arrays to the called function. A single array x0 is necessary to optimize both alpha_i and tau_i at the same time. However, typically, only alpha_i is optimized and tau_i is kept constant. This wrapper allows to use the same function in both scenarios.
- Parameters:
func (function) – Function that calculates least squares residual.
- Returns:
split
- Return type:
function
See also
prony.ls_resFunction to be wrapped during minimization of Prony terms.
- pyvisco.prony.E_relax_norm(time, alpha_i, tau_i)¶
Calculate normalized relaxation modulus values.
- Parameters:
time (array-like) – Time in s.
alpha_i (array-like) – Normalized relaxation moduli (unitless).
tau_i (array-like) – relaxation times in s.
- Returns:
Relaxation modulus values.
- Return type:
numpy.ndarray
- pyvisco.prony.fit_time(df_dis, df_master, opt=False)¶
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) – Contains the discrete relaxation times and corresponding data.
df_master (pandas.DataFrame) – Contains the master curve data.
opt (bool, default = False) – Flag indicates wether the Prony term minimization routine should be executed or not.
- Returns:
prony – Contains the Prony series parameters of the fit.
- Return type:
dict
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.prony.E_freq_norm(omega, alpha_i, tau_i)¶
Calculate normalized storage and loss modulus values.
- Parameters:
omega (array-like) – Angular frequency in rad/s.
alpha_i (array-like) – Normalized relaxation moduli (unitless).
tau_i (array-like) – relaxation times in s.
- Returns:
Concatenated array of normalized storage and loss modulus values.
- Return type:
numpy.ndarray
- pyvisco.prony.fit_freq(df_dis, df_master, opt=False)¶
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) – Contains the discrete relaxation times and corresponding data.
df_master (pandas.DataFrame) – Contains the master curve data.
opt (bool, default = False) – Flag indicates wether the Prony term minimization routine should be executed or not.
- Returns:
prony – Contains the Prony series parameters of the fit.
- Return type:
dict
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.prony.calc_GMaxw(E_0, df_terms, f_min, f_max, decades, modul, **kwargs)¶
Calculate the Generalized Maxwell model data from the Prony series parameter.
- Parameters:
E_0 (numeric) – Instantaneous storage modulus. Same variable name is used for either tensile (E_0) or shear (G_0) loading.
df_terms (pandas.DataFrame) – Contains the Prony series parameters tau_i and alpha_i.
f_min (numeric) – Lower bound frequency for calculation of physical quanitities.
f_max (numeric) – Upper bound frequency for calculation of physical quanitities.
decades (integer) – 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'}) – Indicates wether tensile (
E) or shear (G) modulus data are provided.
- Returns:
df_GMaxw – Contains the calculated Generalized Maxwell model data for the fitted Prony series parameters with the specified boundaries and parameters.
- Return type:
pandas.DataFrame
- pyvisco.prony.GMaxw_temp(shift_func, df_GMaxw, df_coeff, df_aT, freq=None)¶
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 ({'WLF', 'D4', 'D3', 'D2', 'D1'}) – Specifies the shift function to be used for calculations.
df_GMaxw (pandas.DataFrame) – Contains the Generalized Maxwell model data for the reference temperature at different loading rates.
df_coeff (pandas.DataFrame) – Contains the coefficients and parameters for the specified shift function.
df_aT (pandas.DataFrame) – Contains the shift factors. The shift factors are used to identify the Temperature range for the calculation.
freq (array-like, default = [1E-8, 1E-4, 1E0, 1E4]) – Loading frequencies for which the calculations are performed.
- Returns:
Contains the Generalized Maxwell model data for a wide range of temperatures at the specified frequencies.
- Return type:
df_GMaxw_temp
See also
shift.fit_WLFReturns WLF shift functions.
shift.fit_polyReturns polynomial shift functions of degree 1 to 4.
- pyvisco.prony.plot_GMaxw(df_GMaxw, units)¶
Plot Generalized Maxwell model data for the reference temperature.
- Parameters:
df_GMaxw (pandas.DataFrame) – Contains the Generalized Maxwell model data for the reference temperature at different loading rates.
units (dict of {str : str}) – Contains the names of the physical quantities as key and the corresponding names of the units as item.
- Returns:
fig – Plot of calculated storage, loss, and relaxation modulus.
- Return type:
matplotlib.pyplot.figure
- pyvisco.prony.plot_GMaxw_temp(df_GMaxw_temp, units)¶
Plot Generalized Maxwell model data for varies temperature and frequencies.
- Parameters:
df_GMaxw_temp (pandas.DataFrame) – Contains the Generalized Maxwell model data for various temperatures and different loading rates.
units (dict of {str : str}) – Contains the names of the physical quantities as key and the corresponding names of the units as item.
- Returns:
fig – Plot of showing the temperature and rate dependence of the storage, loss, and relaxation modulus.
- Return type:
matplotlib.pyplot.figure
- pyvisco.prony.plot_param(prony_list, labels=None)¶
Plot illustrating the Prony series parameters of one or more fits.
- Parameters:
prony_list (list) – List of prony dictionaries containing the Prony series parameters.
labels (list of str) – List of strings to be used as legend label names.
- Returns:
fig – Plot showing the relaxation moduli over the relaxation times.
- Return type:
matplotlib.pyplot.figure
See also
prony.fitReturns the prony dictionary to be used in prony_list.
- pyvisco.prony.fit(df_dis, df_master=None, opt=False)¶
Generalized function to call the domain dependent curve fitting routine.
- Parameters:
df_dis (pandas.DataFrame) – Contains the discrete relaxation times and corresponding data.
df_master (pandas.DataFrame, default = None) – Contains the master curve data. Not required for the initial fit in the frequency domain (opt = False).
opt (bool, default = False) – Flag indicates wether the Prony term minimization routine should be executed or not.
- Returns:
prony (dict) – Contains the Prony series parameters of the fit.
df_GMaxw (pandas.DataFrame) – Contains the calculated Generalized Maxwell model data for the fitted Prony series parameters.
- pyvisco.prony.plot_fit(df_master, df_GMaxw, units)¶
Plot the master curve and corresponding Prony fit (Gen. Maxwell model).
- Parameters:
df_master (pandas.DataFrame) – Contains the master curve data.
df_GMaxw (pandas.DataFrame) – Contains the calculated Generalized Maxwell model data for the fitted Prony series parameters.
units (dict of {str : str}) – Contains the names of the physical quantities as key and the corresponding names of the units as item.
- Returns:
fig – Domain dependent plot of master curve and Prony fit.
- Return type:
matplotlib.pyplot.figure