Effect of customer demand type on optimization of distributed generation for minimization of energy loss