Collapse dynamics of liquid bridges investigated by time-varying magnetic levitation