A gradient coil system has at least one shim receptacle space for passive shim elements and a decoupling device with which a volume change of components of the gradient coil system caused by a temperature change is mechanically decoupled from the shim receptacle space. This capacitor is charged by a battery through a charging circuit including resistors that charges the capacitor by dividing a voltage of the battery by the resistors. A sensor detects an openclose state of the upper portion.