First-Principle Studies of Structural Phase Transformations