Modeling ecosystems with physiological and morphological adaptation