The invention relates to a coil system for generating a magnetic field having a field-free point at a predefined position on a predefined trajectory, and having a predefinable magnetic field gradient at the field-free point, characterized by N = 2 coplanar coils arranged at the first end of the trajectory and M = 2 coplanar coils at the second end of the trajectory, all the coils being aligned coaxially. Furthermore, the coil system comprises a control device which is adapted to control the currents in the N + M coils in such a way that, upon each predefinition of at least the position of the field-free point on the trajectory and of the magnetic field gradient at the field-free point, those coil currents which lead to minimum non-reactive losses are determined from the solution of a system of linear equations and are set.