Algae dynamics
algae_dynamics.RdCalculates the algal biomass at the next time step from the current algae biomass
Details
The time evolution of the algal biomass \(B\) is described by
$$dB_A/dt = P_A - c_A \cdot B_A$$
where \(c_A\) is the mass-specific rate of consumption calculated
with algae_consumption() and \(P_A\) is the rate at which algae
grows, calculated with getAlgaeProduction().
The dynamical equation is solved analytically to
$$B_A(t+dt) = B_A(t) e^{(- c_A \cdot dt)} +\frac{P_A}{c_A} (1- e^{(-c_A \cdot dt)}).$$
This avoids the stability problems that would arise if we used the Euler method to solve the equation numerically.