Generalized multicomponent equation for activity coefficient calculation