In order to improve the current situation of environment and resources, and improve the quality of electric energy, to develop the distributed power generation system will be the future power grid development inevitable trend, but the locations of the distributed power supply and constant volume is important question。By analyzing the distributed generation of the impact of distribution network, the objective function including investment and operating maintenance cost, environmental factors, network loss costs. Aiming at the shortcomings of the existing PSO algorithm, a linear gradient of learning factor and weight adaptive PSO (LD-SAPSO) algorithm was proposed. Determine the location and capacity of distributed power supply, transformation provides a theoretical basis for distribution network.