In this paper, we first formulate the path loss model of an intelligent reflecting surface (IRS) in terms of IRS reflection coefficients, then adopt a simulated annealing algorithm to determine a global maximum point of the path loss. Consequently, we can improve the performance of IRS-assisted communication system by avoiding such position deviations in practice. Simulation results show that an optimal solution can be achieved by implementing the proposed algorithm.