A comparative thermodynamic study of metal hydride heat transformers and heat pumps