The problem of transition of a mechanical system from one phase state to another is one of the most important problems of the control theory. In this case, a model problem consists in finding the optimal control force which transports the trolley with pendulums moving horizontally, for example, from a state of rest to a new state of rest over a given distance during the fixed time. In their previous papers the authors have shown that when solving such a problem with the help of the Pontryagin maximum principle with minimization of the functional of the control force squared, a high-order constraint is realized automatically (for instance, an eighth-order constraint for the motion of a trolley with two pendulums). That is why, for solving the same problem the generalized Gauss principle has been used that made it possible to find the control force as a polynomial. In the present paper the problem of suppression of oscillation of a trolley with a double pendulum is solved by means of the same principle. It is offered first to find the acceleration of the trolley as a control instead of the force, and then to seek immediately the control force by the obtained law of variation of the optimal acceleration of the trolley. Refs 4. Figs 2