Optimal Planning of CHP Systems