Time variations of fields in superconducting magnets and their effects on accelerators