Text this: Optimal placement, sizing and power factor of distributed generation: A comprehensive study spanning from the planning stage to the operation stage