This article describes the betatron magnetic field simulation in Comsol Multiphysics software package. The model makes it possible to evaluate the betatron focusing properties at the moment of electron displacement onto the target. The simulation results coincide with the experiment described earlier. The study shows the vertical size of the target affects the focal spot size. However, a target size decrease leads to low output dose, since not all electrons reach it. Therefore, the vertical size of the target should be greater than or equal to the vertical dimension of the accelerated beam. * Corresponding author: aak65@tpu.ru