The longitudinal vibrations of an elastic rod controlled by a distributed force, which is applied to individual sections of the rod, are studied. It is assumed that the force varies in space in a piecewise constant manner. Such a mechanical system can be implemented using piezoactuators attached along the rod. The dynamics of the system is determined from the solution of the variational problem following the method of integrodifferential relations. The variational problem is solved analytically. To do this, traveling waves of the d’Alembert type are introduced on the space-time mesh, which determine continuous displacements and a dynamic potential. The latter relates the momentum density and stresses. A control problem is posed under the condition of the weighted minimization of the vibrational energy stored by the rod at the terminal time instant, and the mean potential energy generated by the control actions. The extremal motion and the corresponding control law are found explicitly by solving the Euler–Lagrange equations. As an example, the control capabilities for certain configurations of piezoelectric elements are studied.