Data I/O

Excel file format

Each sheet of the workbook must have exactly four columns and a header row:

ColumnContentUnit
1Temperature T°C
2Frequency fHz
3Complex modulus norm |E*|Pa or MPa
4Phase angle φdegrees (°)

Isotherm layout (default): rows are grouped by temperature — all frequencies for one temperature appear consecutively.

Isochrone layout (Iso=true): rows are grouped by frequency — all temperatures for one frequency appear consecutively.

Multiple sheets in the same workbook are each loaded as an independent DataSeries.


Types

ViscoAnalysis.DataSeriesType
DataSeries

Container for complex-modulus measurements read from one Excel sheet.

Fields

  • data — Dict keyed by temperature (°C) or frequency (Hz in Iso mode). Each entry contains vectors for "f", "omega", "|M*|", "delta", "M*", "M*_1", "M*_2".
  • MPatrue if modulus values are already in MPa (no unit conversion).
  • Isotrue if data is organised by frequency (isochrone layout).
  • name — Sheet name from the workbook.
  • nb_sheet — Total number of sheets in the workbook.
  • list_temp — Sorted vector of temperatures (°C).
  • list_omega — Sorted vector of angular frequencies (rad/s).
  • list_freq — Sorted vector of frequencies (Hz), or same as list_omega in non-Iso mode.
  • wlf — Fitted WLF function T -> log10(aT), set after calling build_shift_factors!.
  • C1, C2 — WLF coefficients at the chosen Tref.
  • _wlf, _C1, _C2 — Internal WLF fit at the first temperature (used when Tref is not in list_temp).
source
ViscoAnalysis.FitResult2S2P1DType
FitResult2S2P1D <: AbstractFitResult

Result of fitting the 2S2P1D model (2 Springs, 2 Parabolic, 1 Dashpot).

Fields

  • Einf, E0 — Glassy / static modulus [MPa].
  • delta — δ shape parameter.
  • tauE — Relaxation time τ_E [s].
  • k, h — Exponents (0 < k < h ≤ 1).
  • beta — β dashpot coefficient.
  • residual — Weighted least-squares objective at optimum.
  • modelE*(p) function (callable).
r = fit2S2P1D(series[1], 10.0)
r(2π * 10.0)   # E* at 10 Hz
source
ViscoAnalysis.FitResult1S2P1DType
FitResult1S2P1D <: AbstractFitResult

Result of fitting the 1S2P1D model (no glassy spring; E∞ is implicitly ∞).

Fields

  • E0 — Static modulus [MPa].
  • delta — δ shape parameter.
  • tauE — Relaxation time τ_E [s].
  • k, h — Exponents (0 < k < h ≤ 1).
  • beta — β dashpot coefficient.
  • residual — Weighted least-squares objective at optimum.
  • modelE*(p) function (callable).
r = fit1S2P1D(series[1], 10.0)
r(2π * 10.0)
source
ViscoAnalysis.FitResultHSType
FitResultHS <: AbstractFitResult

Result of fitting the Huet-Sayegh model (no dashpot; β → ∞).

Fields

  • Einf, E0 — Glassy / static modulus [MPa].
  • delta — δ shape parameter.
  • tauE — Relaxation time τ_E [s].
  • k, h — Exponents (0 < k < h ≤ 1).
  • residual — Weighted least-squares objective at optimum.
  • modelE*(p) function (callable).
r = fitHS(series[1], 10.0)
r(2π * 10.0)
source

Functions

ViscoAnalysis.load_dataFunction
load_data(filename; MPa=false, Iso=false) -> Vector{DataSeries}

Read all sheets of an Excel workbook and return one DataSeries per sheet.

Arguments

  • filename — Path to the .xlsx file.
  • MPa — Set true if the modulus column is already in MPa; otherwise values are assumed to be in Pa and converted (÷ 10⁶).
  • Iso — Set true for an isochrone layout where rows are indexed by frequency instead of temperature.

Excel format expected

Column 1Column 2Column 3Column 4
T (°C)f (Hz)E* norm (Pa/MPa)φ (degrees)

All sheets in the workbook must share the same layout.

Example

using ViscoAnalysis
series = load_data("EBR_T0_T10.xlsx"; MPa=true)
series[1]          # first sheet
series[1].list_temp   # available temperatures
source

DataSeries — field reference

After calling load_data the returned DataSeries objects have the following fields:

FieldTypeDescription
nameStringSheet name from the workbook
MPaBooltrue if modulus is stored in MPa
IsoBooltrue if data is in isochrone layout
list_tempVector{Float64}Sorted unique temperatures [°C]
list_freqVector{Float64}Sorted unique frequencies [Hz]
list_omegaVector{Float64}Sorted unique angular frequencies [rad/s]
wlfUnion{Nothing, Function}Fitted WLF function T → log₁₀(aT)
C1, C2Float64WLF coefficients at the chosen Tref

Each temperature entry d[T] is a Dict{String, Any} with keys:

KeyDescription
"f"Frequencies [Hz]
"omega"Angular frequencies [rad/s]
"|M*|"Modulus norm [MPa]
"delta"Phase angle [°]
"M*"Complex modulus [MPa]
"M*_1"Storage modulus E₁ [MPa]
"M*_2"Loss modulus E₂ [MPa]

Dict-like access

DataSeries supports a dict-like interface:

d = series[1]
d[10.0]              # entry at T = 10 °C
haskey(d, 10.0)      # check if temperature exists
keys(d)              # all temperatures
length(d)            # number of temperature entries
for (T, entry) in d  # iteration
    ...
end