# Ectotherm Models

## The general ectotherm model

The NicheMapR package includes a comprehensive algorithm for the complete heat, water and nutritional budget of an ectotherm to be solved, as described in detail in Kearney and Porter (2019).

The program comprises a set of FORTRAN subroutines that encode calculations of the steady-state heat budget for an ectotherm and its thermoregulatory responses, given a set of functional traits that parameterise its morphology, physiology and behaviour. The R wrapper for the FORTRAN code is ectorun. The function ectotherm receives the user input data and sets up the call to ectorun.

The ectotherm model is driven by the microclimate model output and has the option of being run with or without the Dynamic Energy Budget (DEB) model. When run without the DEB model, the ectotherm model will provide the body temperature, behavioural state (active/inactive, shade level selected, depth underground, etc.), water loss rate and metabolic rate each hour. When run with the DEB model turned on (and parameters set accordingly), the model will provide the trajectory of growth, development and reproduction of the organism as well as a wider range of mass budget outputs.

The Ectotherm Model Tutorial provides greater details on the operation of this model.

## Transient heat budget models for ectotherms

In addition, the NicheMapR package has algorithms for computing 'transient heat budgets' of ectotherms. These differ from the steady state calculations made by the ectotherm function in that they account for the lag effects on body temperature of rapidly changing environmental conditions. This can be important for large ectotherms, especially those above about 1kg.

There are four functions for computing transient heat budgets in NicheMapR:

- onelump; which analytically computes the trajectory of temperature change of an organism or object in a constant thermal environment;
- onelump_var; which uses a numerical solver to compute the trajectory of temperature change of an organism or object in a time-varying thermal environment;
- twolump; which uses a numerical solver to compute the trajectory of temperature change of an organism or object in a time-varying thermal environment that is broken into an outer shell and an inner core (may be needed for large organisms);
- trans_behav; which applies the latter two functions to compute thermoregulatory behaviour of an organism in a time-varying thermal environment as it shuttles between shade and sun.

The derivation of these algorithms is described in the Transient Equation Derivation vignette and the thermoregulatory algorithm will be more fully described in a future publication (currently in prep).

# References

Kearney, M. R., & Porter, W. P. (2019). NicheMapR - an R package for biophysical modelling: the ectotherm and Dynamic Energy Budget models. Ecography, 42, 1–12. doi:10.1111/ecog.04680