Insights on the origin of the structural phase transition in BaV10O15 from electronic structure calculations and the effect of Ti-doping on its structure and electrical transport properties