Chapter 20 Growth models with endogenous population: A general framework