This paper first analyzes the internal dynamic process of the UPFC,then a five order differential equation is presented to describe dynamic behavior of UPFC. In term of this,a optimal control system is designed.Dynamic simulation of a transmission system demonstrates the effectiveness.