In this article, James Christian and Holly Middleton-Spencer explore some of the complex territory inhabited by a magnetic pendulum. This simple tabletop toy is capable of generating remarkably intricate behaviours that are bound up with concepts such as basins of attraction, final state sensitivity and fractal dimension. These mathematical ideas underpin modern understandings of physics, where the pioneering work of Edward Lorenz and his discovery of the butterfly effect take centre stage.
Introduction
The magnetic pendulum provides what is perhaps one of the most mysterious and striking examples of unpredictability in classical physics. A demonstration is fairly easy to make, comprising a stand and boss so that a magnetic bob at the end of a string hangs freely from a fixed suspension point. In the base plane, one typically has three other similar magnets all arranged in the ‘opposite poles attract’ configuration (relative to the bob) and placed on the vertices of an equilateral triangle whose geometric centre is aligned beneath the straight-down position.
Pull the bob back in any arbitrary direction, release and watch its subsequent motion develop with rapt attention and an increasing level of bemusement. The bob flits wildly back and forth, pulled simultaneously toward the three base-plane magnets in an invisible tug-of-war. After a few moments, most casual observers are ready to concede defeat: they have no idea which base-plane magnet will ultimately win the competition.
Now try repeating the experiment multiple times starting off (as close as we can manage) from the same position. It becomes clear that the strangeness does not stop with meandering trajectories as two more imponderables emerge. First, there is little correlation between successive winning magnets. Second, though less easy to quantify directly, the winding paths followed by the bob are all different from one another. Taken together, these three interrelated qualities endow what should be an infinitely-predictable executive toy with a palpable sense of randomness. How is such a paradox allowed by physics?
The resolution of that paradox lies in the realm of chaos theory and Edward Lorenz’s paradigm-shifting discovery in the early 1960s of the butterfly effect [1]. More formally, the magnetic pendulum is exhibiting the phenomenon of sensitive dependence on initial conditions, or final state sensitivity (FSS): any fluctuation at a system’s input (no matter how imperceptibly small) can become magnified through intrinsic feedback loops and eventually result in dramatically different behaviour at the output [2]. This fundamental property is sufficient to define what is meant by ‘chaos’. It is often a major roadblock to accurate long-range forecasting – even in reltively simple systems – once nonlinear effects enter the mix. Since the initial condition for our first pull-and-release trial can never be reproduced with infinite precision, the magnetic pendulum provides a tabletop embodiment of Lorenz’s imaginary butterfly flapping its wings in Brazil and creating a tornado in Texas [1] (see Figure 1).

The objective of this article is to consider the pendulum problem and to illustrate how some of its inherent complexity can be visualised and understood through the prism of dynamical systems [3]. Our approach to formulating a phenomenological model will largely follow Peitgen, Jürgens and Saupe [4]; it involves a blend of classical mechanics with a slightly revised formulation for magnetic interactions, and we consider the case of four base-plane magnets rather than three.
A toy equation
To capture the essence of the dynamics, any physical model must account for three main ingredients: the pendulum’s free swing, dissipation (e.g., due to air resistance) and the interaction between the bob and base-plane magnets. We proceed by placing the four magnets at unit distance from the origin of the plane so that they sit on the corners of a square (see Figure 1). In three-dimensional (3D) space, the bob moves along the lower surface of a sphere whose centre coincides with the suspension point and whose radius is equal to the length of the string. However, numerical integration of the spherical-pendulum equations of motion is fraught with computational headaches [5]. Instead, we adopt a plan view of the system by looking down directly onto the
plane so that the projection of the bob’s position is given by the vector
at time
.
In this reduced geometry, gravity supplies a torque that tends to pull the bob back to its straight-down position above the centre of the square, . If the string is much longer than typical
and
displacements, then the small-angle approximation may be safely deployed [6]. In so doing, the gravitational restoring force is modelled by
, and we choose units so that the constant of proportionality may be set to one.
Lumped losses are accommodated by anticipating that damping is proportional to speed and hence , where
and
is the dimensionless loss coefficient.
Magnetism is enormously complicated and it is not unreasonable to assert that a complete understanding of magnetic phenomena eludes physics even today. As testament, only relatively recently has a formula been derived to quantify the force between two small magnetic dipoles [7]. The magnitude of that force is predicted to vary as rather than
[4, 6]. Compare that surprising situation to Coulomb’s law of electrostatics, where the inverse-square relation for point charges (electric monopoles) has been known for nearly two and a half centuries.
It is now instructive to combine the effects of gravity and magnetism into a potential energy function , where
(1)
The first term in is the standard paraboloid associated with an isotropic linear restoring force, while
sums over
potentials centred on base-plane positions
(the constant
is added simply to ensure that the potential-energy minimum is always
). The set of numbers
determine the polarity of the constituent base-plane magnets relative to the bob:
corresponds to the attraction of opposite poles and
to the repulsion of like poles (see Figure 2). Singular forces that would result as
are suppressed by introducing a parameter
, which might be interpreted physically as the dimensionless average height of the bob above the base plane [6]. We have set
throughout, for definiteness.

The equation of motion is now , where
denotes the spatial gradient operator. More explicitly,
(2)
Equation (2) does a superb job of mimicking the complex dynamics observed in any demonstration of a magnetic pendulum. The left-hand side is just a damped simple-harmonic oscillator moving in 2D while the right-hand side accounts for pairwise magnetic interactions and provides a coupling between otherwise-independent motions along the and
directions. It is the interplay between these dissipative and nonlinear feedback loops that facilitates the emergence and richness of deterministic chaos (note that our model contains no trace of randomness!).
Fixed points and their stability
For arbitrary initial data and
, we expect the pendulum to come to rest as
because damping smoothly and continuously drains kinetic energy out of the motion. These equilibrium solutions, denoted by
, are associated with zero velocity (
, a state of rest) and zero acceleration (
, experiencing no net force). From Equation (2), it follows that
must satisfy
(3)
and it is worth spending some time thinking about what this equation means in physical terms.
Inspection of Figure 2 leads us to expect that Equation (3) should probably have up to five acceptable roots. A base-plane magnet in the opposite-poles-attract configuration, say magnet and with
, typically gives rise to an absolute minimum in the potential energy surface. However, the precise location of that minimum is not at
, as one might first suppose. Rather, it is at some other nearby position determined by physics (namely, where the net forces due to gravity and all the competing magnetic interactions balance one another exactly).
When all the base-plane magnets have for
, symmetry demands that there exist four
values lying at the same angular positions as
but displaced slightly towards the origin in the radial direction. Any evolving
is then pulled towards these four unique fixed-point attractors in the
plane. Such points are stable since they correspond to potential-energy minima: small disturbances tend to result in vibrations that diminish as
, with the pendulum relaxing back to its stationary state.
Potential-energy maxima tend to characterise like-poles-repel configurations. Such points are unstable and may be classified as repellors since they are associated with repulsive forces. That is not to say that the pendulum cannot stop at potential maxima; such an outcome is just extremely unlikely since any vanishingly small perturbation (such as from a slight table wobble) destroys the unstable equilibrium state. We also note that the origin of the plane may or may not be an equilibrium point, depending upon the choice of
. When all four magnetic interactions are attractive,
corresponds to an unstable maximum: any disturbance to
tends to result in trajectories that diverge and ultimately stop at one of the other attracting magnets.
Basins of attraction
To proceed, we consider first the release from rest initial-value problem (IVP) and when all the magnetic interactions are attractive. The displacement of the bob at time zero, denoted by , is freely adjustable but its velocity is always set to zero,
. A desired section of the
plane is then represented by a grid of points, and Equation (2) integrated systematically for every initial condition
contained within that section. The winning magnet from each calculation is recorded, and the results are colour-coded and then overlayed on top of the
plane.

In Figure 3, the set of all initial conditions whose subsequent trajectories converge on magnet 1 is shown in black; that collection of black points is the basin of attraction for magnet 1 [8]. Similarly colour-coded results apply for the other magnets 2 (red), 3 (yellow) and 4 (white), but the colour provides no information about the path taken from a start point to its corresponding end point. Alternatively, one might consider the impulsive IVP by fixing the starting position at an equilibrium point such as and applying an impulse in a particular direction. Such an impulse can be controlled by specifying the components of the initial velocity
, and the patterns that emerge in the
plane are similar to those given in Figure 3.
The basins of attraction emerging from both IVPs have some fascinating properties. Whether in real space [the plane] or velocity space [the
plane], the basin patterns have the same symmetries as a square (four reflections and four rotations). Much of that symmetry is lost when, say, magnet 3 is flipped by setting
. The potential around
becomes a hill instead of a valley (see Figure 2), and the magnetic interaction is, thus, always repulsive in that neighbourhood. We then find the basins have the same symmetry as an isosceles triangle (a single reflection in the line
and no rotations; see Figure 4).

Another feature of the basins is that, while they clearly make very striking intertwined patterns, an increasing level of dissipation tends to decrease the density of the pattern substructure. Moreover, the boundaries between adjacent colours are examples of fractals: that is, patterns exhibiting some degree of self-similarity (which may be exact or statistical) under magnification.
More subtly, a solid interface between any two colours never quite forms; the other two colours are always tightly packed in. For instance, in Figure 3 one cannot jump from red to yellow without also jumping across black and white [9].
Uncertainty and unpredictability
As a way to quantify the susceptibility of the pendulum to initial fluctuations, we deploy the method developed by Grebogi et al. [2] in their pioneering analysis of FSS. For each initial condition , two other related starting points are also considered: typically
and
. The small positive number
might be interpreted either as a formal perturbation to the pendulum’s input or as the radius of a disc of uncertainty representing a finite limit on experimental precision. If
,
and
all give rise to trajectories that converge to the same magnet, then
does not possess FSS (see Figure 5).

Consider a domain of initial conditions, , comprising a total of
points and with
of them susceptible to FSS. Many systems follow a power-law relation
, where
is the uncertainty exponent. When
is a 2D domain (such as we have here), one typically defines
, with
being known as the uncertainty dimension. After a back-of-the-envelope calculation, one finds
(4)
and that . Greater sensitivity to fluctuations at the input is associated with smaller
exponents and thus, with
values that tend toward 2. Thus, in quite an elegant way, the degree of FSS exhibited by a system can be directly related to the level of pattern complexity in its basin boundaries. In contrast, boundaries that are regular (i.e., non-fractal) are characterised by
.

Figure 6 shows the log–log spectra computed for the basins of attraction given in the centre panes of Figure 3. In the small regime, the curves are very nearly linear with the property that
decreases with increasing
. This result makes physical sense and agrees with what we might conclude just from a qualitative inspection: stronger dissipation appears to reduce overall pattern complexity. Such a reduction is manifest mathematically as a lowering of the uncertainty dimension, which ranges from
at low
to
at high
.
Towards larger regimes, the log–log spectra gradually flatten out. It follows that
is greater in these regions, providing some evidence that the density of pattern detail in the magnetic-pendulum basin boundaries is an inherent function of scale (structures with this property are sometimes classified generically as scale-dependent fractals). Similar trends in behaviour are also found for the patterns in the central panes of Figure 4.
Concluding remarks
We have gone beyond the standard equilateral-triangle incarnation of the magnetic pendulum [4, 6], implemented a more physical model of magnetic interactions [7], experimented with polarity, computed basins of attraction and explored susceptibility to initial fluctuations by estimating fractal dimension. In other words, we have had enormous fun playing with a purely deterministic toy equation, which, despite all its simplifications, remains a highly nonlinear problem in the 4D phase space [5].
The phenomenon of sensitive dependence on initial conditions appears ubiquitously throughout Nature, and it is far more pervasive than one might first recognise. It turns out to be a key feature of almost every system that has competing feedback loops [3], even highly simplified models such as Equation (2). More profoundly, the relationship between final state sensitivity and the mathematics of fractal dimension, as discovered by Grebogi et al. [2] over three decades ago, appears to be deeply embedded within physical law.
The magnetic pendulum really is a paradigm of unpredictability, and there is almost no limit to the curiosity-driven variations one might try. The magical quality of its motion is also a very powerful tool for outreach purposes and in appealing to the imagination, especially when experimental demonstrations are accompanied by computer visualisations. Audiences – whether they are prospective students at open days, undergraduates in lectures or enthusiasts at MathsJam gatherings – are invariably mesmerised by the hypnotic motion of the swinging bob and its uncertain destination. As a device for piquing interest in physics and mathematics, is there anything better?
James M. Christian CMath FIMA and Holly A. J. Middleton-Spencer
University of Salford
References
- Lorenz, E.N. (1972) Predictability; does the flap of a butterfly’s wings in Brazil set off a tornado in Texas? American Association for the Advancement of Science, 139th Meeting.
- Grebogi, C., McDonald, S.W., Ott, E. and Yorke, J.A. (1983) Final state sensitivity: an obstruction to predictability, Phys. Lett., vol. 99, pp. 415–418.
- Alligood, K.T., Sauer, T.D. and Yorke, J.A. (2000) Chaos: An Introduction to Dynamical Systems, Springer.
- Peitgen, H.-O., Jürgens, H. and Saupe, D. (1992) Chaos and Fractals: New Frontiers of Science, Springer.
- Kana, D.D. and Fox, D.J. (1995) Distinguishing the transition to chaos in a spherical pendulum, Chaos, vol. 5, pp. 298–310.
- Motter, A.E., Gruiz, M., Károlyi, G. and Tél, T. (2013) Doubly transient chaos: generic form of chaos in autonomous dissipative systems, Phys. Rev. Lett., vol. 111, no. 194101.
- Yung, K.W., Landecker, P.B. and Villani, D.D. (1998) An analytical solution for the force between two magnetic dipoles, Mag. Elec. Sep., vol. 9, pp. 39–52.
- Nusse, H.E. and Yorke, J.A. (1996) Basins of attraction, Science, vol. 271, pp. 1376–1380.
- Daza, A., Wagemakers, A., Sanjuán, M.A.F. and Yorke, J.A. (2015) Testing for basins of Wada, Sci. Rep., vol. 5, no. 16579.
Reproduced from Mathematics Today, April 2020
Download the article, Chaos in the Magnetic Pendulum (pdf)



