Due to limitations of fossil energy resources and the environmental issues, renewable energy sources have gained much more attention in recent decades. In this regard, photovoltaic system application hasalso increased consistently. Photovoltaics generated power depends on factors such as solar radiation and temperature. Since the solar radiation changes based on time and weather conditions, the generated power would fluctuate which affect voltage profile, power quality, and system performance. Nowadays, with the increment in the number of sensitive loads and power electronic devices, power quality is considered as an important factor in distribution systems. Therefore, one of the main challenges toward the use of PV system is the fluctuation of generated power as clouds passing and sudden variations occur in solar radiation intensity. Since PV systems have a static nature and there are no mass or accelerating inertia, effects of fluctuations in solar radiation and correspondingly in generated power would transfer rapidly and cause voltage variations. Traditional control methods utilizing shunt capacitor banks, on-load tap changers, and voltage regulators, have a slow response which cannot compensate fluctuations associated with photovoltaic generation. Furthermore, application of fast and advanced complementary equipments for distribution sources are not justified economically. Therefore, presenting an optimal control method based on PV inverter is both fast and economical. In this thesis,first, we modeled PV systems and the corresponding electronic interfaces based on active and reactive power exchange. Then we investigated the effect of variations in weather condition and solar radiation on systems generated power. The power quality phenomenon of voltage sag resulting from power fluctuations, are investigated. Finally, an optimal algorithm is presented to control the PV inverter for reactive power injection,which improves the voltage profile. The extent of injected reactive power is limited to minimize grid and inverter losses and consumed energy considering voltage standard limits. Finally, the effect of photovoltaic systems and grid various parameters on the extent of voltage profile variation is investigated. Keywords: Optimal Reactive Power Injection, Photovoltaic Systems Dynamic Modeling, Voltage Profile Control, Voltage Sag, Weather Condition, Voltage