Modeling of non-axisymmetric magnetic perturbations in tokamaks. (5th March 2015)