Title: Thermodynamics of multicomponent systems with chemical and magnetic interactions