Influence of stresses on structure and properties of Ti and Zr- based alloys from first-principles simulations