API Reference

Abstract types

ThermalPhysiology.AbstractArrheniusModelType
AbstractArrheniusModel <: AbstractTPCModel

Abstract type for Arrhenius-family temperature-correction models. These return a dimensionless correction factor equal to 1 at T_ref. Parameters are stored in Kelvin (TA, Tref). DEBtool convention.

source

Primary dispatch functions

ThermalPhysiology.temperature_correctionFunction
temperature_correction(model, T) → Float64

Return the dimensionless temperature-correction factor at temperature T for an AbstractArrheniusModel. The factor equals 1.0 at the model's reference temperature T_ref.

T may be a Unitful temperature quantity or a bare Float64 (°C assumed).

source

Arrhenius-family structs

ThermalPhysiology.ArrheniusModelType
ArrheniusModel(; T_A, T_ref)

One-parameter temperature-correction model. Returns a dimensionless correction factor equal to 1 at T_ref.

temperature_correction(m, T) = exp(T_A/T_ref - T_A/T)

Parameters stored in Kelvin. Convenience constructor arrhenius accepts Unitful quantities or bare values.

source
ThermalPhysiology.SharpSchoolHighModelType
SharpSchoolHighModel(; T_A, T_ref, T_H, T_AH, rate_at_reference)

Sharpe-Schoolfield model with high-temperature enzyme deactivation.

rate(T) = rate_at_reference * exp(T_A/T_ref - T_A/T) /
          (1 + exp(T_AH/T_H - T_AH/T))

Formula from Schoolfield, Sharpe & Magnuson (1981).

source
ThermalPhysiology.SharpSchoolFullModelType
SharpSchoolFullModel(; T_A, T_ref, T_L, T_AL, T_H, T_AH, rate_at_reference)

Schoolfield (1981) full model with both low- and high-temperature enzyme deactivation. rate_at_reference is the rate in the absence of enzyme inactivation at Tref (i.e. assumes Tref is in the central Arrhenius zone).

rate(T) = rate_at_reference * (T/T_ref) * exp(T_A/T_ref - T_A/T) /
          (1 + exp(T_AL*(1/T - 1/T_L)) + exp(T_AH*(1/T_H - 1/T)))

The (T/T_ref) pre-factor comes from collision-frequency theory and is part of the original Schoolfield et al. (1981) Eq. (4); it is also present in rTPC's sharpeschoolfull_1981.R. At biological temperatures it accounts for ~5–10% variation.

Low term exp(T_AL*(1/T - 1/T_L)) is large at T < TL (cold suppression); high term `exp(TAH*(1/TH - 1/T))` is large at T > TH (heat denaturation).

For the DEBtool-normalised variant (no T/Tref, actual rate at Tref guaranteed), use SharpSchoolDEBModel.

References: Schoolfield, Sharpe & Magnuson (1981) J Theor Biol 88:719; sharpeschoolfull_1981.R in rTPC; ArrFunc5 in Rezende dynamic.landscape1.R.

source
ThermalPhysiology.SharpSchoolDEBModelType
SharpSchoolDEBModel(; T_A, T_ref, T_L, T_AL, T_H, T_AH, rate_at_reference)

DEBtool-normalised Sharpe-Schoolfield model. rate_at_reference is the actual observed rate at Tref — the correction is applied in both numerator and denominator, so `temperaturecorrection(m, Tref) == rateatreference` for any Tref.

rate(T) = rate_at_reference * exp(T_A/T_ref - T_A/T) *
          (1 + exp(T_AL/T_ref - T_AL/T_L) + exp(T_AH/T_H - T_AH/T_ref)) /
          (1 + exp(T_AL/T   - T_AL/T_L)   + exp(T_AH/T_H - T_AH/T))

This is tempcorr in DEBtool_J and the form used in NicheMapR for CTE calculations. Use this variant when fitting to rate data collected at a known reference temperature or when computing constant temperature equivalents within DEB.

Reference: Kooijman (2010) DEB Theory §2.6; DEBtool_J tempcorr.m.

source
ThermalPhysiology.JohnsonLewinModelType
JohnsonLewinModel(; T_A, T_ref, T_H, T_AH, rate_at_reference)

Original Johnson-Lewin (1946) enzyme-kinetics model. Equivalent to the high-deactivation Sharpe-Schoolfield form but historically distinct.

source

Phenomenological TPC structs

ThermalPhysiology.UniversalTPCModelType
UniversalTPCModel(; T_opt, E, maximum_performance)

Universal thermal performance curve (Arnoldi et al. 2025, PNAS). Two-parameter model: y(x) = exp(x) * (1 - x) where x = (T - T_opt) / E.

  • T_opt: optimal temperature (stored in K internally)
  • E: thermal breadth (K); related to Arrhenius temperature by E = T_ref² / T_A
  • maximum_performance: peak rate at T_opt

The UTPC thermal breadth connects to TDT z-value: z = E * log(10).

source
ThermalPhysiology.DeutschModelType
DeutschModel(; maximum_rate, optimal_temperature, critical_thermal_maximum, width_parameter)

Modified Deutsch (2008, PNAS) thermal performance curve. Gaussian rise below Topt; quadratic decline above Topt to CTmax.

T < T_opt: rate = maximum_rate * exp(-((T - T_opt) / (2*width_parameter))^2)
T > T_opt: rate = maximum_rate * (1 - ((T - T_opt) / (T_opt - CTmax))^2)
source
ThermalPhysiology.Briere1ModelType
Briere1Model(; rate_constant, minimum_temperature, maximum_temperature)

Briere 1 (1999) thermal performance curve. rate = rate_constant * T * (T - T_min) * sqrt(T_max - T) for Tmin < T < Tmax.

source
ThermalPhysiology.Briere2ModelType
Briere2Model(; rate_constant, minimum_temperature, maximum_temperature, shape_parameter)

Briere 2 (1999) — generalised form with shape exponent. rate = rate_constant * T * (T - T_min) * (T_max - T)^(1/shape_parameter)

source
ThermalPhysiology.GaussianModelType
GaussianModel(; maximum_rate, optimal_temperature, width_parameter)

Symmetric Gaussian TPC. rate = maximum_rate * exp(-0.5 * ((T - T_opt) / width_parameter)^2)

source
ThermalPhysiology.Thomas2012ModelType
Thomas2012Model(; rate_constant, shape_parameter, optimal_temperature)

Thomas et al. (2012) thermal performance curve. rate = rate_constant * (T - T_opt + b) * (T - T_opt - b) * (-1) where b is a shape parameter. Returns 0 outside the performance range.

source
ThermalPhysiology.PawarModelType
PawarModel(; rate_at_reference, activation_energy, deactivation_energy,
             peak_temperature, reference_temperature)

Pawar et al. (2018) metabolic TPC: Arrhenius rise with high-T deactivation, parameterised in biologically meaningful terms.

source
ThermalPhysiology.Lactin2ModelType
Lactin2Model(; rate_constant, maximum_temperature, delta_temperature, intercept)

Lactin 2 (1995) thermal performance curve. rate = exp(rate_constant * T) - exp(rate_constant * T_max - (T_max - T) / delta_T) + intercept

source

TDT structs

ThermalPhysiology.LogLinearTDTModelType
LogLinearTDTModel(; z_value, reference_ctmax, reference_duration, incipient_temperature)

Log-linear thermal death time model (Jørgensen et al. 2021, Sci Reports).

Survival time at constant temperature T: t(T) = referenceduration * 10^((referencectmax - T) / z_value)

Parameters:

  • z_value: °C for 10× change in knockdown time (= -1/slope of log10(t) ~ T)
  • reference_ctmax: sCTmax at reference_duration (°C)
  • reference_duration: exposure duration defining reference_ctmax (min)
  • incipient_temperature: Tc* below which thermal injury is negligible (°C)

Rezende's Tmax (mean τ = 1 min) relates by: Tmax = referencectmax + z * log10(referenceduration).

source
ThermalPhysiology.ToleranceLandscapeType
ToleranceLandscape(; z_value, temperature_maximum, mean_assay_temperature, survival_curve)

Semi-parametric thermal tolerance landscape (Rezende et al. 2014, Funct Ecol; Rezende et al. 2020, Science 369, 1242–1245).

Built from individual-level knockdown data via fit_tolerance_landscape. Stores the full empirical survival probability curve S(τ) collapsed to the mean assay temperature using z-shifting.

Individual vs. population framing: dynamic_survival tracks the survival probability of one individual moving through S(τ) as heat exposure accumulates. The state variable can move in both directions: down under heat stress, up during recovery (via recovery_model). This contrasts with accumulated_injury (Jørgensen), which is monotone and population-level.

Fields:

  • z_value: °C for 10× change in knockdown time
  • temperature_maximum: T_max, temperature at which mean τ = 1 min (°C)
  • mean_assay_temperature: T_mean, mean assay temperature for S(τ) curve (°C)
  • survival_curve: n×2 matrix [timeminutes, survivalfraction (0–1)]
source

TPC properties

ThermalPhysiology.optimal_temperatureFunction
optimal_temperature(m) → Float64 (K)

Temperature at which thermal_performance is maximised. Analytic for UniversalTPCModel; numerical via Roots.jl for others. Returns Inf for monotone models (e.g. ArrheniusModel).

source
ThermalPhysiology.thermal_breadthFunction
thermal_breadth(m; threshold=0.0) → Unitful temperature difference

Temperature range over which thermal_performance exceeds threshold. = CTmax - CTmin.

source
ThermalPhysiology.q10Function
q10(m, T; delta=10.0) → Float64

Temperature coefficient: ratio of performance at T+delta to T. delta is in °C (or K — equivalent for differences).

source

TDT properties

ThermalPhysiology.lethal_temperatureFunction
lethal_temperature(m, duration; T_search=(273.0, 373.0)) → Float64 (°C)

Temperature at which survival_time equals duration (minutes). Inverse of survival_time.

source
ThermalPhysiology.z_valueFunction
z_value(m) → Float64

Temperature increment for 10-fold change in survival time. Direct field for LogLinearTDTModel; derived from Arrhenius temperature for others.

source
ThermalPhysiology.temperature_maximumFunction
temperature_maximum(m::LogLinearTDTModel) → Float64

Temperature (°C) at which the mean knockdown time equals 1 minute (Rezende parameterisation).

T_max = reference_ctmax + z_value × log10(reference_duration)
source

TDT fluctuating-temperature functions

ThermalPhysiology.accumulated_injuryFunction
accumulated_injury(m, T_series, dt_minutes)

Cumulative thermal injury under a fluctuating temperature series (Jørgensen 2021 Eq. 3). Injury per step = dt / survival_time(T) when T ≥ incipienttemperature, else 0. Injury = 1.0 corresponds to lethal dose. Returns a cumulative vector of length `length(Tseries)`.

source
ThermalPhysiology.time_to_failureFunction
time_to_failure(m, T_series, dt_minutes; critical_injury=1.0)

Time (minutes) at which accumulated injury reaches critical_injury. Returns Inf if the organism survives the entire series.

source
ThermalPhysiology.dynamic_ctmaxFunction
dynamic_ctmax(m, ramp_rate_per_min; start_temperature=m.incipient_temperature)

Predict the dynamic CTmax (knockdown temperature in a ramping assay) from TDT parameters. Reference: Jørgensen et al. 2021 Eq. 7a; TDT_from_Static.R.

source
ThermalPhysiology.static_ctmax_from_dynamicFunction
static_ctmax_from_dynamic(m, dctmax, ramp_rate_per_min; start_temperature=m.incipient_temperature)

Recover static sCTmax from a dynamic CTmax measurement and ramp rate. Reference: Jørgensen et al. 2021 Eq. 7b.

source

ToleranceLandscape functions

ThermalPhysiology.dynamic_survivalFunction
dynamic_survival(tl, T_series; dt_minutes=1.0, recovery_model=nothing)

Predict individual survival probability under a fluctuating temperature series using the Rezende (2020) iterative curve-shifting algorithm.

At each time step:

  1. Compute shift = 10^((T_mean - T_i) / z) — scales time axis for current temperature
  2. Find current time-equivalent position in the shifted S(τ) and advance by dt_minutes
  3. Read new survival fraction via linear interpolation
  4. If recovery_model is provided, add thermal_performance(recovery_model, T_i) * dt_minutes and clamp to 1.0 (matches ArrFunc5 recovery in dynamic.landscape1.R)

Returns a vector of survival fractions (0–1) at each time step.

Reference: dynamic.landscape() in Thermal landscape functions.R (lines 76–89); dynamic.landscape1() in dynamic.lansdcape1.R.

source
ThermalPhysiology.daily_mortalityFunction
daily_mortality(tl, T_series_24h; dt_minutes=1.0, recovery_model=nothing)

Fraction of individuals that die during one day's temperature exposure.

source
ThermalPhysiology.cumulative_survivalFunction
cumulative_survival(tl, T_series_per_day; dt_minutes=1.0, recovery_model=nothing)

Cumulative survival probability over multiple days (Rezende 2020 Eq. S9). T_series_per_day is a vector of 24-h temperature vectors (one per day). Full overnight recovery is assumed between days; pass recovery_model for within-day partial recovery via dynamic_survival.

source

Constant temperature equivalent

ThermalPhysiology.constant_temperature_equivalentFunction
constant_temperature_equivalent(m, T_series) → Unitful temperature

The single constant temperature that produces the same mean thermal response as the time series T_series. Used in DEBtool parameter estimation when body temperatures fluctuate (Kearney NicheMapR vignette, getCTE).

Algorithm:

  1. Compute thermal response at each T → responses = f.(m, T_series)
  2. Average → mean_response
  3. Root-find T_eq such that f(m, T_eq) = mean_response

Analytic solution for ArrheniusModel; numerical for all others.

References:

  • Kearney NicheMapR vignette, getCTE function
  • Jensen's inequality: for convex f, CTE > arithmetic mean temperature
source

Cross-family conversions

ThermalPhysiology.tdt_from_tpcFunction
tdt_from_tpc(m::UniversalTPCModel; reference_duration=60.0, incipient_temperature)

Convert UTPC parameters to a LogLinearTDTModel. UTPC thermal breadth E and TDT z-value are linked: z = E × log(10).

source

Curve fitting

ThermalPhysiology.fit_thermal_performance_curveFunction
fit_thermal_performance_curve(ModelType, temperatures, rates; initial_parameters=nothing)

Fit a TPC model to data using nonlinear least squares (LsqFit.jl).

Returns a fitted instance of ModelType. temperatures and rates are plain vectors (°C assumed for temperatures). initial_parameters is an ordered vector matching the struct field order; estimated from data heuristics if nothing.

source
fit_thermal_performance_curve(SharpSchoolFullModel, temperatures, rates; ...)
fit_thermal_performance_curve(SharpSchoolDEBModel, temperatures, rates; ...)

Fit a Sharpe-Schoolfield model using NLS (LsqFit.jl) with graphical initial parameter estimates from the Arrhenius plot (Schoolfield, Sharpe & Magnuson 1981, Figure 2).

Keyword arguments:

  • T_ref: reference temperature (Unitful quantity or bare Kelvin); default 298.15u"K" (25 °C).
  • initial_parameters: manual override [T_A, T_L, T_AL, T_H, T_AH, rate_at_reference]; if nothing, estimated from the graphical method.
  • log_transform: fit in log-space (minimise sum of squared log-residuals); default true. This matches the Schoolfield et al. (1981) Marquardt fit and is appropriate when rates span orders of magnitude. Set false for absolute residuals (use with weights).
  • weights: weight vector for LsqFit (only used when log_transform=false).
source
ThermalPhysiology.fit_thermal_death_time_curveFunction
fit_thermal_death_time_curve(data::StaticKnockdownData; reference_duration=60.0,
                              incipient_temperature=nothing)

Fit a LogLinearTDTModel to group-summary knockdown data via linear regression on log10(t) ~ T (TDTfromStatic.R, lines 68–71).

Returns a LogLinearTDTModel. If incipient_temperature is nothing, defaults to minimum(temperatures) - 5.0.

source
fit_thermal_death_time_curve(data::DynamicKnockdownData; reference_duration=60.0,
                              incipient_temperature=nothing, initial_z=2.5)

Fit a LogLinearTDTModel from dynamic CTmax measurements (Jørgensen 2021 Eq. 7a).

  • ≥3 ramp rates: NLS via LsqFit.jl
  • 2 ramp rates: Roots.jl (multiroot)
  • 1 ramp rate: algebraic inverse of Eq. 7a (requires reference_ctmax guess = mean dCTmax - 1°C)
source
ThermalPhysiology.fit_tolerance_landscapeFunction
fit_tolerance_landscape(data::IndividualKnockdownData; n_bins=1000)

Build a ToleranceLandscape from individual-level knockdown data (Rezende et al. 2014, Funct Ecol; corresponds to tolerance.landscape() in the R reference code).

Algorithm:

  1. Linear regression: log10(time) ~ temperature to estimate z_value (slope = -1/z) and temperature_maximum (T at log10(t) = 0, i.e. t = 1 min).
  2. Compute mean assay temperature T_mean = mean(temperatures).
  3. Z-shift each individual knockdown time to T_mean: shifted_time = t * 10^((T - T_mean) / z_value)
  4. Sort shifted times; compute empirical survival fractions S(τ).
  5. Store as n_bins-row survival_curve matrix via linear interpolation for consistency.

Returns ToleranceLandscape.

source
ThermalPhysiology.IndividualKnockdownDataType
IndividualKnockdownData(; temperatures, knockdown_times)

Individual-level knockdown data: one entry per organism. Required for fit_tolerance_landscape.

  • temperatures: assay temperature per individual (°C)
  • knockdown_times: time to knockdown per individual (min)
source
ThermalPhysiology.StaticKnockdownDataType
StaticKnockdownData(; temperatures, knockdown_times)

Group-summary TDT data: one mean/median knockdown time per assay temperature. Sufficient for fit_thermal_death_time_curve.

  • temperatures: assay temperatures (°C)
  • knockdown_times: mean/median time to failure per temperature (min)
source
ThermalPhysiology.DynamicKnockdownDataType
DynamicKnockdownData(; ramp_rates, dynamic_ctmax_values, start_temperature)

Dynamic CTmax measurements at various ramp rates.

  • ramp_rates: heating rates (°C/min)
  • dynamic_ctmax_values: knockdown temperature at each ramp rate (°C)
  • start_temperature: temperature at which ramp begins (°C)
source

Registry

ThermalPhysiology.THERMAL_REGISTRYConstant
THERMAL_REGISTRY :: Dict{Symbol, ThermalModelEntry}

Global registry of all thermal models provided by ThermalPhysiology.jl. Keys are Symbol names (e.g. :arrhenius, :utpc, :log_linear_tdt).

Use model_names to list keys and thermal_models to retrieve entries, optionally filtered by :arrhenius, :phenomenological, or :tdt family.

source
ThermalPhysiology.model_namesFunction
model_names(; family=nothing) → Vector{Symbol}

Return all registered model keys, optionally filtered by family (:arrhenius, :phenomenological, :tdt, or nothing for all).

source

Unit utilities

ThermalPhysiology.ea_to_taFunction
ea_to_ta(E_a) → T_A

Convert activation energy in eV to Arrhenius temperature in K: T_A = E_a / k_B. Accepts Unitful quantities or bare Float64 (assumed eV).

source
ThermalPhysiology.ta_to_eaFunction
ta_to_ea(T_A) → E_a

Convert Arrhenius temperature in K to activation energy in eV: E_a = T_A × k_B. Accepts Unitful quantities or bare Float64 (assumed K).

source