Ferrofluid in a changing magnetic field