Equations of metasomatic reactions