An investigation of the reduction of TiO2 by Mg in H2 atmosphere