1: \begin{abstract}
2: Infinite-dimensional control systems with outputs are considered in the Hamiltonian formulation with generalized coordinates.
3: An explicit scheme for constructing a dynamic observer for this class of systems is proposed with arbitrary gain coefficients.
4: Sufficient conditions for the convergence of the constructed observer are obtained on the basis of the invariance principle.
5: This result is applied to a flexible beam model attached to a mass-spring system with lumped and distributed actuators.
6: The estimation error decay is illustrated with numerical simulations of finite-dimensional approximations of the observer dynamics.
7: \end{abstract}