Micromagnetics and hysteresis as prototypes for complex systems