Cops and Robbers (and Zombies and Humans)

Cops and Robbers is a mathematical game in which pursuers (cops) attempt to capture evaders (robbers). The game is one of many pursuit-evasion games, each of which is governed by a different set of rules. The general goal of these problems is to determine the number of pursuers required to capture a given number of evaders.

The GIFs above show two versions of the game. The first is similar to the standard Cops and Robbers rendition, and the second is best described as “Zombies and Humans”.

In both versions, an evader moves in the direction that gets it furthest away from the pursuers (focusing more on the closer pursuers), and a pursuer moves in the direction that gets it closest to the evaders (focusing more on the closer evaders).

In the first simulation, members of both groups have a constant speed. In the second simulation, members of a group move more quickly the closer they are to members of the opposite group, and slower when further away.

Mathematica code posted here.

Additional sources not linked above: [1] [2]

Thanks for following! Here are some things:

I’m Brian. I’m currently working towards my M.S. in applied math and I love making physics and math visualizations.

Suggestions and requests are always welcome. Seriously. If there are any physics or math topics you want to know more about or anything you’d like to see visualized, pleaseeeee contact me.

I also want to note that all of my visualizations and code are free to use and adapt for non-profit-making purposes, as long as you cite me and link back to my original post.

You can also follow me on Twitter @BriMaster3000 for some cool science articles, supplemental post info, and a ton of unrelated stuff.

Signal Collection and Parabolic Reflectors

reflector is a type of antenna that receives and focuses various types of signals. Reflectors have numerous applications, from satellite dishes and telescopes, to long-distance microphones and car headlights. One common feature of these examples is their parabolic shape, giving them the name parabolic reflectors.

It turns out that paraboloids are the perfect shape for focusing signals from distant sources. When pointed directly at the the incoming signal, a parabolic reflector (GIF 1) collects the signal to a single focal point, where a receiver, called a feed horn, is placed to collect the focused transmission.

In many applications, parabolic reflectors are too costly to produce, so spherical reflectors (GIF 2) are used instead. The disadvantage of spherical reflectors is that they have multiple focal points, and therefore produce blurry results.

Mathematica code posted here.

This code is incredibly messy and I guarantee there’s a better way to calculate this. Please contact me if you have suggestions!

Taylor Series Approximations

A Taylor series is a way to represent a function in terms of polynomialsSince polynomials are usually much easier to work with than complicated functions, Taylor series have numerous applications in both math and physics.

There are many equations in physics — like the one describing the motion of a pendulum — that are impossible to solve in terms of elementary functions. “Approximations using the first few terms of a Taylor series can make [these] otherwise unsolvable problems” solvable for a restricted area of interest [1].

The GIF above shows the five-term Taylor series approximation of a sine wave about x=0.

Mathematica code:

f[x_] := Sin[x]
ts[x_, a_, nmax_] :=
Sum[(Derivative[n][f][a]/n!)*(x - a)^n, {n, 0, nmax}]
Manipulate[Plot[{f[x], ts[x, 0, nmax]}, {x, -2*Pi, 2*Pi},
PlotRange -> {-1.45, 1.45},
PlotStyle -> {{Thick, Cyan}, {Thick, Dotted, Yellow}},
AxesStyle -> LightGray, Background -> Darker[Gray, 0.8]],
{nmax, 1, 30, 1}]

Rotational Stability

Time for an experiment! Find a book and secure it shut using tape or a rubber band. Now experiment with spinning the book while tossing it into the air. You’ll notice that when the book is spun about its longest or shortest axis it rotates stably, but when spun about its intermediate-length axis it quickly wobbles out of control.

Every rigid body has three special, or principal axes about which it can rotate. For a rectangular prism — like the book in our experiment — the principal axes run parallel to the shortest, intermediate-length, and longest edges, each going through the prism’s center of mass. These axes have the highest, intermediate, and lowest moments of inertia, respectively.

When the book is tossed into the air and spun, either about its shortest or longest principal axis, it continues to rotate about that axis forever (or until it hits the floor). For these axes, this indefinite, stable rotation occurs even when the axis of rotation is slightly perturbed.

When spun about its intermediate principal axis, though, the book also continues to rotate about that axis indefinitely, but only if the axis of rotation is exactly in the same direction as the intermediate principal axis. In this case, even the slightest perturbation causes the book to wobble out of control.

The first simulation above shows a rotation about the unstable intermediate axis, where a slight perturbation causes the book to wobble out of control. The second and third simulations show rotations about the two stable axes.

Unfortunately, as far as my understanding goes, there’s no intuitive, non-mathematical explanation as to why rotations about the intermediate principal axis are unstable. If you’re interested, you can find the stability analysis here.

Mathematica code posted here.

Additional sources not linked above: [1[2] [3] [4]

Gabriel’s Horn and the Painter’s Paradox

Gabriel’s Horn is a three-dimensional horn shape with the counterintuitive property of having a finite volume but an infinite surface area.

This fact results in the Painter’s Paradox — A painter could fill the horn with a finite quantity of paint, “and yet that paint would not be sufficient to coat [the horn’s] inner surface” [1].

If the horn’s bell had, for example, a 6-inch radius, we’d only need about a half gallon of paint to fill the horn all the way up. Even though this half gallon is enough to entirely fill the horn, it’s not enough to even coat a fraction of the inner wall!

The mathematical explanation is a bit confusing if you haven’t taken a first course in calculus, but if you’re interested, you can check it out here.

Mathematica code:

x[u_, v_] := u
y[u_, v_] := Cos[v]/u
z[u_, v_] := Sin[v]/u
Manipulate[ParametricPlot3D[{{x[u, v], y[u, v], z[u, v]}},
{u, 1, umax}, {v, 0, 2*Pi},
PlotRange -> {{0, 20}, {-1, 1}, {-1, 1}},
Mesh -> {Floor[umax], 20}, Axes -> False, Boxed -> False],
{{umax, 20}, 1.1, 20}]

Lagrangian Points

The Lagrangian points are the five locations in an orbital system where the combined gravitational force of two large masses is exactly canceled out by the centrifugal force arising from the rotating reference frame.

At these five points, the net force on a third body (of negligible mass) is 0, allowing the third object to be completely stationary relative to the two other masses. That is, when placed at any of these points, the third body stays perfectly still in the rotating frame.

The first image shows the fields due to the first mass, the second mass, and the rotating reference frame. When added together, these fields generate the effective field shown in the second image. The five Lagrangian points are indicated with gray spheres.

The first three Lagrangian points (labeled L1, L2, and L3) lie in line with the two larger bodies and are considered metastable equilibria. L4 and L5 lie 60° ahead of and behind the second body in its orbit and are considered stable equilibria.

Lagrangian points offer unique advantages for space research, and the Lagrangian points of the Sun-Earth system are currently home to four different satellites.

Mathematica code posted here.

Additional sources not linked above: [1] [2] [3] [4] [5]

Sonic Booms and the Doppler Effect

The Doppler effect is the shift in the frequency of a wave observed when the source of the wave (or the medium through which the wave travels) is moving relative to the observer.

We’re most familiar with the Doppler effect as it appears in sound waves traveling through air (i.e., pressure waves) – think of how the pitch of a siren drops as an emergency vehicle passes you. The first GIF shows a stationary source and the second shows a source moving to the right at 40% the speed of sound. Notice in the second GIF how the wavefronts are closer together in front of the source (producing a higher frequency) and further apart behind it (producing a lower frequency).

The Doppler effect is interesting in its own right, but things get much more exciting when the source travels at speeds greater than or equal to the speed of sound.

When the source travels at the speed of sound (GIF 3) the source will always be at the leading edge of the waves it produces, and when traveling faster than the speed of sound (GIF 4), the source will always be in front of the waves it produces. In both of these cases, notice how the waves overlap with each other. The high pressure areas of each wave constructively interfere and produce a region of extremely high pressure (much higher than in the surrounding areas). This rapid rise in air pressure is a shock wave, and the sound associated with it is a sonic boom.

In each of the GIFs above we see the radiating wavefronts on the left, and the pressure distribution and interference of the waves on the right.

Mathematica code posted here.

Chaos and the Double Pendulum

chaotic system is one in which infinitesimal differences in the starting conditions lead to drastically different results as the system evolves.

Summarized by mathematician Edward Lorenz, ”Chaos [is] when the present determines the future, but the approximate present does not approximately determine the future.”

There’s an important distinction to make between a chaotic system and a random system. Given the starting conditions, a chaotic system is entirely deterministic. A random system, on the other hand, is entirely non-deterministic, even when the starting conditions are known. That is, with enough information, the evolution of a chaotic system is entirely predictable, but in a random system there’s no amount of information that would be enough to predict the system’s evolution.

The simulations above show two slightly different initial conditions for a double pendulum — an example of a chaotic system. In the left animation both pendulums begin horizontally, and in the right animation the red pendulum begins horizontally and the blue is rotated by 0.1 radians (≈ 5.73°) above the positive x-axis. In both simulations, all of the pendulums begin from rest.

Mathematica code posted here.

[For more information on how to solve for the motion of a double pendulum, check out my video here.]

Determining the Motion of a Double Pendulum

[See the related post here.]