View source: R/07-nutrient-regeneration.R
| calculate_nutrient_balance | R Documentation |
Calculates daily nitrogen and phosphorus fluxes (ingestion, retention, excretion) for a fish using prey and predator elemental concentrations.
calculate_nutrient_balance(consumption, weight_gain, processed_nutrient_params)
consumption |
Vector of consumption by prey type (g/day) |
weight_gain |
Predator weight gain (g/day) |
processed_nutrient_params |
List with processed nutrient parameters |
A named list with three elements:
Named list with six numeric scalars describing daily
nitrogen fluxes (g N/day): consumed, assimilated,
growth, excretion, egestion, and
assimilation_efficiency (dimensionless fraction, 0–1).
Same structure as nitrogen but for
phosphorus (g P/day).
Numeric scalar. Predator weight gain (g/day), as supplied.
Nutrient regeneration modelling is an **experimental feature** under active development. This function can be called directly to compute daily N and P fluxes for a single time step, but it is **not yet integrated** into the main 'run_fb4()' simulation loop. Full integration (automatic daily nutrient tracking, inclusion in 'fb4_result' objects, and TMB backend support) is planned for a future release. The API may change.
params <- list(
prey_n_concentrations = c(0.025, 0.030),
prey_p_concentrations = c(0.004, 0.005),
predator_n_concentration = 0.030,
predator_p_concentration = 0.004,
n_assimilation_efficiency = c(0.80, 0.80),
p_assimilation_efficiency = c(0.60, 0.60)
)
calculate_nutrient_balance(consumption = c(2.0, 1.0),
weight_gain = 0.5,
processed_nutrient_params = params)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.