In this paper, both standard IEEE test systems 57-bus and Algerian 59-bus are considered. To enhance the power flow of these two considerable networks in terms of voltage profile and reduce the real and reactive total transmission losses, the inclusion of flexible alternating current transmission systems (FACTS) devices is one of the best solutions. For this, a static synchronous compensator (STATCOM) is proposed. Our code is written in the MATLAB computing environment, based on finding the weakest buses in the network, and placing one or two STATCOMs in an appropriate place; in the next step, there would be recalculation of the power flow again. The results of power flow compared with the popular MATPOWER software environment show the exactitude of our code calculation, and the enhancement of voltage profile, especially in buses where STATCOM is placed. Furthermore, the reduction of real and reactive losses shows the effectiveness of the FACTS device proposed.