An efficient algorithm for obtaining the reduced connection equations for a class of dynamic systems