Magnetic control of a tokamak plasma