Dynamic modelling of an anaerobic digester for wastes at the territory level