predict_dynamic_growth: Growth under dynamic conditions

View source: R/predict_dynamic_growth.R

predict_dynamic_growthR Documentation

Growth under dynamic conditions

Description

[Superseded]

The function predict_dynamic_growth() has been superseded by the top-level function predict_growth(), which provides a unified approach for growth modelling.

Regardless on that, it can still predict population growth under dynamic conditions based on the Baranyi model (Baranyi and Roberts, 1994) and secondary models based on the gamma concept (Zwietering et al. 1992).

Model predictions are done by linear interpolation of the environmental conditions defined in env_conditions.

Usage

predict_dynamic_growth(
  times,
  env_conditions,
  primary_pars,
  secondary_models,
  ...,
  check = TRUE,
  logbase_logN = 10,
  logbase_mu = logbase_logN,
  formula = . ~ time
)

Arguments

times

Numeric vector of storage times to make the predictions

env_conditions

Tibble (or data.frame) describing the variation of the environmental conditions during storage. It must have with the elapsed time (named time by default; can be changed with the "formula" argument), and as many additional columns as environmental factors.

primary_pars

A named list defining the parameters of the primary model and the initial values of the model variables. That is, with names mu_opt, Nmax, N0, Q0.

secondary_models

A nested list describing the secondary models.

...

Additional arguments for ode().

check

Whether to check the validity of the models. TRUE by default.

logbase_logN

Base of the logarithm for the population size. By default, 10 (i.e. log10). See vignette about units for details.

logbase_mu

Base of the logarithm the growth rate is referred to. By default, the same as logbase_logN. See vignette about units for details.

formula

An object of class "formula" describing the x variable. . ~ time as a default.

Value

An instance of DynamicGrowth().

Examples


## Definition of the environmental conditions

library(tibble)

my_conditions <- tibble(time = c(0, 5, 40),
    temperature = c(20, 30, 35),
    pH = c(7, 6.5, 5)
    )

## Definition of the model parameters

my_primary <- list(mu_opt = 2,
    Nmax = 1e8,N0 = 1e0,
    Q0 = 1e-3)

sec_temperature <- list(model = "Zwietering",
    xmin = 25, xopt = 35, n = 1)

sec_pH = list(model = "CPM",
    xmin = 5.5, xopt = 6.5,
    xmax = 7.5, n = 2)

my_secondary <- list(
    temperature = sec_temperature,
    pH = sec_pH
    )

my_times <- seq(0, 50, length = 1000)

## Do the simulation

dynamic_prediction <- predict_dynamic_growth(my_times,
    my_conditions, my_primary,
    my_secondary)

## Plot the results

plot(dynamic_prediction)

## We can plot some environmental factor with add_factor

plot(dynamic_prediction, add_factor = "temperature", ylims= c(0, 8),
    label_y1 = "Microbial count (log CFU/ml)",
    label_y2 = "Storage temperature (C)")


biogrowth documentation built on May 29, 2024, 4:17 a.m.