Periodic and chaotic programs of optimal intertemporal allocation in an aggregative model with wealth effects