A control mathematical model of the dynamic system is established according to the differential equation obtained from the structural dynamic system.Mixed energy of time interval is defined and condensation formulas are given with the help of the variational principle.Further the substructural condensation method in structural mechanics is used for the Riccati equation solution,based on the simulation relation between computational structural mechanics and optimal control.Then,the optimal control of the dynamic system is obtained.The numerical example shows the effectiveness of this method.