Model of Demographic Cycles in a Traditional Society: the Case of Ancient China