Thermodynamics of titanium reduction process with particular reference to the preparation of titanium tetraoxide and titanium hydride