Pinning and Dynamics of Magnetic Vortices