  In order to generate a desired Kelvin (magnetic) force in a target subdomain
moving along a prescribed trajectory, we propose a minimization problem with a
tracking type cost functional. We use the so-called dipole approximation to
realize the magnetic field, where the location and the direction of the
magnetic sources are assumed to be fixed. The magnetic field intensity acts as
the control and exhibits limiting pointwise constraints. We address two
specific problems: the first one corresponds to a fixed final time whereas the
second one deals with an unknown force to minimize the final time. We prove
existence of solutions and deduce local uniqueness provided that a second order
sufficient condition is valid. We use the classical backward Euler scheme for
time discretization. For both problems we prove the $H^1$-weak convergence of
this semi-discrete numerical scheme. This result is motivated by
$\Gamma$-convergence and does not require second order sufficient condition. If
the latter holds then we prove $H^1$-strong local convergence. We report
computational results to assess the performance of the numerical methods. As an
application, we study the control of magnetic nanoparticles as those used in
magnetic drug delivery, where the optimized Kelvin force is used to transport
the drug to a desired location.
