Variational Principle for Eigenvalue Problems of Hamiltonian System