The article deals with dynamics of a heterogeneous system of two cylindrical surfaces with different physical and mechanical qualities, which are impacted by shock load. An effective method was suggested for optimization process of elimination sediment from pipe as the result of theoretical studies. This method allows transforming a heterogeneous system of pipe into a homogeneous system, which preserves its functional purpose. Shock impact is applied for transformation, which is optimized according to the suggested qualitative criteria of the transformation process and removing sediment from pipe.