In this study, a heat convection model of the reflow oven and a heat conduction model of the soldering area are proposed based on heat transfer theory, and a dynamic Thomas algorithm is developed for solving linear equations with coefficient matrix evolving over time in the tridiagonal system, which is derived from a heat transfer problem with moving boundaries in the solder phase transition process. We have also carried out numerical simulations for investigating the accuracy of the mathematical model, in which the temperature profiles are calculated and compared for different cases with considering or ignoring phase transformations, respectively. Parameters of reflow soldering, such as the conveyor speed, the set temperature in each zone, and a part of the heating factor, are optimized by the use of the nondominated sorting genetic algorithm II. By comparing the temperature profile and optimal solutions in the two cases, numerical results show that phase transitions of the solder have great impacts on optimal parameters and the slope of temperature profiles. Moreover, the phenomenon that the heating factor varies with the maximum set temperature in a banded distribution is investigated and analyzed, which is an important part of this work.