Effect of Substitution and Doping on Cathode Materials in Li- and Na-based Batteries: First-Principle Study