  The construction of modified equations is an important step in the backward
error analysis of symplectic integrator for Hamiltonian systems. In the context
of partial differential equations, the standard construction leads to modified
equations with increasingly high frequencies which increase the regularity
requirements on the analysis. In this paper, we consider the next order
modified equations for the implicit midpoint rule applied to the semilinear
wave equation to give a proof-of-concept of a new construction which works
directly with the variational principle. We show that a carefully chosen change
of coordinates yields a modified system which inherits its analytical
properties from the original wave equation. Our method systematically exploits
additional degrees of freedom by modifying the symplectic structure and the
Hamiltonian together.
