Question: How to use variational principle to get Hamiltonian from DE?

I am studying a nonlinear wave equation and trying to reproduce the energy balance method shown in a research paper. First, the original partial differential equation is reduced to an ordinary differential equation using a traveling wave transformation. After obtaining the reduced equation, the paper rewrites it in a form suitable for the energy balance method and derives the corresponding variational principle and Hamiltonian invariant. Then a trial periodic solution in cosine form is assumed. Using the Hamiltonian invariant and some initial conditions, the parameters of the trial function are determined and a periodic solution is obtained.

I would like to know how to implement this procedure in Maple. Specifically,  compute the Hamiltonian invariant from the equation, substitute the cosine trial function, and determine the unknown parameter in the trial solution using the energy balance method. I will attach images from the paper that show the derivation steps I am trying to reproduce. Any guidance on how to perform these symbolic steps in Maple would be very helpful.

f-s.mw

Please Wait...