Trapping of a supersonic beam in a traveling magnetic wave