A model for kinetics of segregation of several interstitial and substitutional components to different kinds of traps at grain boundaries is derived by applying the Thermodynamic Extremal Principle. Evolution equations for the site fractions of the segregating elements at the grain boundary, considered as independent variables, are presented and solved numerically. The kinetic model is applied to the case of Mo containing C, O, and B as impurities and a spectrum of trapping energies obtained from first principles simulations. This newly developed model offers an efficient tool for understanding segregation from several kinds of components at different types of traps.