Mechanism of formation of MTiO3 (M=Sr or Ba) by the gel method