  We introduce new methods for the numerical solution of general Hamiltonian
boundary value problems. The main feature of the new formulae is to produce
numerical solutions along which the energy is precisely conserved, as is the
case with the analytical solution. We apply the methods to locate periodic
orbits in the circular restricted three body problem by using their energy
value rather than their pe- riod as input data. We also use the methods for
solving optimal transfer problems in astrodynamics.
