To solve the conflict between calculating speed and accuracy in conventional dynamic optimal power flow(DOPF) algorithms, a variation model of DOPF is developed and the optimal condition for the model proposed is derived. A new algorithm based on the Radau collocation method for solving the DOPF is proposed, which has such advantages as high efficiency and accuracy. The numerical test on an actual system shows that the new algorithm can meet the requirement of online dispatch of the power system.