A study on complexation and evaluation of thermodynamic parameters of bivalent and trivalent metal complexes