Phase transformations in titanium hydrides