First-principles modelling of magnesium titanium hydrides