Optimal Design of der for Economic/Environmental Sustainability of Local Energy Communities