the magnetic field of the earth, and of other planets that have magnetic fields, is caused by dynamo action of molten iron in the planetary core. this convection (movement) generates electric currents which in turn give rise to magnetic fields. in simulations of planetary dynamos, reversals occur from the underlying dynamics. for example, gary glatzmaier and collaborator paul roberts of ucla ran a numerical model of the coupling between electromagnetism and fluid dynamics in the earth's interior. their simulation reproduced key features of the magnetic field over more than 40,000 years of simulated time and the computer-generated field reversed itself. global field reversals at irregular intervals have also been observed in a laboratory liquid metal experiment vks2.