Question: How can I obtain the Hamiltonian?

How can I obtain the Hamiltonian of Eq. (1) in terms of dynamical variables in Maple?

restart

with(PDEtools)

declare(phi(xi), psi(xi))

phi(xi)*`will now be displayed as`*phi

 

psi(xi)*`will now be displayed as`*psi

(1)

r1 := (1/2*(phi(xi)^2-2*c))*(diff(diff(phi(xi), xi), xi))+((-(1/2)*phi(xi)^2+c)*(k*phi(xi)^2-Omega)^2*(phi(xi)^2-c)^2/(phi(xi)^4*(phi(xi)^2-2*c)^2)-(-k*phi(xi)^2+c*k+Omega)*(k*phi(xi)^2-Omega)*(phi(xi)^2-c)/(phi(xi)^2*(phi(xi)^2-2*c))-(1/2)*k^2*phi(xi)^2+Omega*k+(diff(phi(xi), xi))^2+1)*phi(xi) = 0

(1/2)*(phi(xi)^2-2*c)*(diff(diff(phi(xi), xi), xi))+((-(1/2)*phi(xi)^2+c)*(k*phi(xi)^2-Omega)^2*(phi(xi)^2-c)^2/(phi(xi)^4*(phi(xi)^2-2*c)^2)-(-k*phi(xi)^2+c*k+Omega)*(k*phi(xi)^2-Omega)*(phi(xi)^2-c)/(phi(xi)^2*(phi(xi)^2-2*c))-(1/2)*k^2*phi(xi)^2+Omega*k+(diff(phi(xi), xi))^2+1)*phi(xi) = 0

(2)

r2 := simplify(%)

(-4*phi(xi)^3*(-(1/2)*phi(xi)^2+c)^2*(diff(diff(phi(xi), xi), xi))+(-2*phi(xi)^6+4*phi(xi)^4*c)*(diff(phi(xi), xi))^2-2*phi(xi)^6+(-c^2*k^2+2*Omega*c*k-Omega^2+4*c)*phi(xi)^4+Omega^2*c^2)/(-2*phi(xi)^5+4*c*phi(xi)^3) = 0

(3)

pa := {diff(diff(phi(xi), xi), xi) = diff(psi(xi), xi), diff(phi(xi), xi) = psi(xi)}

{diff(diff(phi(xi), xi), xi) = diff(psi(xi), xi), diff(phi(xi), xi) = psi(xi)}

(4)

r3 := subs(pa, r2)

(-4*phi(xi)^3*(-(1/2)*phi(xi)^2+c)^2*(diff(psi(xi), xi))+(-2*phi(xi)^6+4*phi(xi)^4*c)*psi(xi)^2-2*phi(xi)^6+(-c^2*k^2+2*Omega*c*k-Omega^2+4*c)*phi(xi)^4+Omega^2*c^2)/(-2*phi(xi)^5+4*c*phi(xi)^3) = 0

(5)

psixif := isolate(r3, diff(psi(xi), xi))

diff(psi(xi), xi) = -(1/4)*(-(-2*phi(xi)^6+4*phi(xi)^4*c)*psi(xi)^2+2*phi(xi)^6-(-c^2*k^2+2*Omega*c*k-Omega^2+4*c)*phi(xi)^4-Omega^2*c^2)/(phi(xi)^3*(-(1/2)*phi(xi)^2+c)^2)

(6)

NULL

Download Hamiltonian.mw

Please Wait...