Planning Distributed Energy Systems