First-principles calculation of crystal structures and energies of Ti-H system