Learn R Programming

fb4package (version 2.0.0)

predator_energy_eq1: Energy density from interpolated data - Equation 1 (Low-level)

Description

Retrieves energy density from pre-calculated daily data. The function accesses both energy_data[day] (start of day) and energy_data[day + 1] (end of day) during weight calculations, so the vector must have n_days + 1 elements (e.g., 366 for a 365-day simulation: indices 1 to 366 represent days 0 to 365).

Usage

predator_energy_eq1(weight, day, energy_data)

Value

Energy density (J/g)

Arguments

weight

Fish weight (g) - not used in this equation

day

Simulation day (integer, 1-based)

energy_data

Numeric vector of energy densities (J/g). Must have length n_days + 1 — one value per day boundary, from the start of day 1 through the end of the last day. For a 365-day simulation, provide 366 values. Use approx(..., xout = 0:n_days) or seq(ED_ini, ED_end, length.out = n_days + 1) to generate this vector. If only initial and final values are known, use ED_ini/ED_end in the predator parameters instead.