The integration of renewable energy systems into electricity grids is a solution for strengthening electricity distribution networks (SEDNs). Renewable energies such as solar photovoltaics are suitable for reinforcing a low-voltage line by offering an electrical energy storage system. However, the integration of photovoltaic systems can lead to problems of harmonic distortion due to the presence of direct current or non-linear feedback in networks from other sources. Therefore, connection standards exist to ensure the quality of the energy before injection at a point of common coupling (PCC). In this work, particle swarm optimization (PSO) is used to control a boost converter and to evaluate the power losses and the harmonic distortion rate. The test on the IEEE 14 bus standard makes it possible to determine the allocation or integration nodes for other sources such as biomass, wind or hydrogen generators, in order to limit the impact of harmonic disturbances (LIHs). The evaluation of the harmonic distortion rate, the power losses as well as the determination of the system size is done using an objective function defined based on the integration and optimization constraints of the system. The proposed model performs better since the grid current and voltage are stabilized in phase after the photovoltaic source is injected.