First-principles study of the structural energetics of PdTi and PtTi