Energy intake functions of ectotherms and endotherms derived from their body mass growth