The analysis and calculation of equilibria in complex metallurgical systems