Skip to contents

predict_dynamic_inactivation() solves a dynamic Weibull-Peleg type inactivation model over a time-varying environmental profile. The output is returned on the base-10 logarithmic scale.

Usage

predict_dynamic_inactivation(
  profile,
  model = "weibull_peleg",
  secondary = "constant",
  start,
  times = NULL,
  dt = 0.01,
  method = "rk4",
  temperature = "temperature"
)

Arguments

profile

A dynamic_profile() object or data frame with a time column.

model

Character string. Currently only "weibull_peleg" is supported.

secondary

Character string defining the secondary model for the Peleg rate parameter b. Use "constant" for constant conditions or "z_value" for a log-linear temperature effect.

start

Named list. Supply logN0, shape parameter n, and either b for secondary = "constant" or b_ref, T_ref, and z for secondary = "z_value".

times

Optional numeric vector of output times.

dt

Maximum integration step used by the internal RK4 solver.

method

Solver method. Currently only "rk4" is implemented.

temperature

Name of the temperature column in profile.

Value

A predmicror_dynamic_prediction data frame with time, logN, log_survival, temperature, and metadata attributes.

Examples

profile <- dynamic_profile(time = c(0, 10, 20), temperature = c(55, 58, 60))
pred <- predict_dynamic_inactivation(
  profile = profile,
  start = list(logN0 = 7, b_ref = 0.15, T_ref = 55, z = 8, n = 1.2),
  secondary = "z_value",
  dt = 0.25
)
head(pred)
#> dynamic_inactivation prediction
#>   model: weibull_peleg
#>   secondary: z_value
#>   rows: 6
#>   time response     logN log_survival temperature
#> 1 0.00 7.000000 7.000000   0.00000000      55.000
#> 2 0.25 6.974179 6.974179  -0.02582092      55.075
#> 3 0.50 6.936086 6.936086  -0.06391380      55.150
#> 4 0.75 6.892892 6.892892  -0.10710807      55.225
#> 5 1.00 6.845659 6.845659  -0.15434062      55.300
#> 6 1.25 6.794898 6.794898  -0.20510161      55.375