With the increasing penetration of PV, LV distribution networks experience the condition of reverse power flow and also voltage increase in a part of the network. As a result, the capacity of the installed feeders is approximately within the range of the nominal value defined for them. Therefore, the proper assessment of the impact of PV in distribution networks seems necessary. In this paper, we have investigated the effect of PV systems in low-voltage and medium-voltage (MV) distribution system, and suitable online strategies were presented to alleviate these problems. In this regard, comprehensive modeling and analysis for LV and MV distribution networks have been performed. Therefore; this will allow the proper allocation of PV systems in the network. Using the approach as mentioned above, PV networks can be modeled for medium-voltage three-wire systems and low-voltage four-wire systems, which include Y-Δ transformers and ground impedance. PV systems modeling based on temperature , and ambient radiation data, inverter efficiency, PV panel parameters and V-I feature will be done. By using the above approach, it will be possible to optimally allocate PV systems in LV and MV distribution networks. In addition, a suitable method for carrying out load flow in distribution systems along with PV systems is provided, and in this regard, a suitable design will be proposed to analyze the effect of PV systems in distribution networks. Based on this plan, which was based on stabilizing the voltage of the network feeders at a nominal value, it was shown that the changes in the working conditions for PV systems in the presented algorithm and structure cannot have a negative impact on the network performance.