A circuit model of hysteresis and creep