Dynamic generalization of Stoner–Wohlfarth model