Realization of Arbitrary Hysteresis by a Low-dimensional Gradient Flow