Precision magnetic balance for the measurement of variable magnetic fields