The calculus of jets and nonlinear Hamiltonian systems