Modelling the geomagnetic field