Learn R Programming

fb4package (version 2.0.0)

analyze_growth_temperature_sensitivity: Analyze growth rate sensitivity to temperature and feeding levels

Description

Analyzes how growth rates respond to different temperature and feeding level combinations. Uses p-values (proportion of maximum consumption capacity) to simulate feeding scenarios from survival levels (p ~0.2) to maximum capacity (p = 1.0). Parallelized for efficiency.

Usage

analyze_growth_temperature_sensitivity(
  bio_obj,
  temperatures = seq(8, 18, by = 2),
  p_values = seq(0.3, 1, by = 0.1),
  simulation_days = 365,
  oxycal = 13560,
  parallel = FALSE,
  n_cores = NULL,
  verbose = TRUE
)

Value

A data frame with one row per temperature-p_value combination and columns:

temperature

Temperature tested (°C).

p_value

Feeding level (proportion of Cmax) tested.

growth_rate

Specific growth rate (percent per day).

final_weight

Predicted final weight (g).

total_consumption

Total consumption over the simulation period (g).

Arguments

bio_obj

Bioenergetic object containing species parameters and environmental data

temperatures

Vector of temperatures to test in °C (default: 8-18°C by 2°C steps)

p_values

Vector of p-values representing feeding levels as proportion of Cmax (default: 0.3-1.0)

simulation_days

Number of days to simulate (default: 365)

oxycal

Oxycalorific coefficient in J/g O2 (default: 13560)

parallel

Use parallel processing (default: FALSE)

n_cores

Number of cores for parallel processing (default: detectCores() - 1)

verbose

Show progress information (default: TRUE)

Examples

Run this code
# \donttest{
data(fish4_parameters)
sp   <- fish4_parameters[["Oncorhynchus tshawytscha"]]$life_stages$adult
info <- fish4_parameters[["Oncorhynchus tshawytscha"]]$species_info
bio  <- Bioenergetic(
  species_params     = sp,
  species_info       = info,
  environmental_data = list(
    temperature = data.frame(Day = 1:30, Temperature = rep(12, 30))
  ),
  diet_data = list(
    proportions = data.frame(Day = 1:30, Prey1 = 1.0),
    energies    = data.frame(Day = 1:30, Prey1 = 5000),
    prey_names  = "Prey1"
  ),
  simulation_settings = list(initial_weight = 100, duration = 30)
)
bio$species_params$predator$ED_ini <- 5000
bio$species_params$predator$ED_end <- 5500
results <- analyze_growth_temperature_sensitivity(
  bio,
  temperatures     = c(2, 14),
  p_values         = c(0.4, 0.7),
  simulation_days  = 30,
  verbose          = FALSE
)
# }

Run the code above in your browser using DataLab