the bouncing ball…

one of the classic examples of a simple discrete-time dynamical system comes from a bouncing ball. if you let a ball go above a table, then, assuming everything is perfectly flat, etc., a simple model for the dynamics is x(n+1)=r x(n), where 0<r<1 is the coefficient of restitution and x(n) is the height of the n-th bounce. very well: that has a simple explicit solution that ends with the ball coming to rest.

but what happens if we give the table a sinusoidal oscillation? let’s take a look…

a bouncing ball on an oscillating table: not a simple system

this is likewise modeled as a dynamical system, but no longer 1-dimensional — it is a 2-dimensional discrete-time dynamical system. without going into a derivation, let me say that the two variables are related to the time-between-bounces and the velocity-upon-impact. indexed by n, the bounce number, this leads to complicated behaviors. of course, everything depends as well on parameters, such as ball size, mass, frequency of oscillation, and initial condition, as you can see from the following simulation.

many balls… many futures…

this system goes straight to the heart of why 2-d discrete-time dynamics can be chaotic. we won’t go into details on this quite yet… but let me say that this is one of the four chaotic dynamical systems that appears in the beginning of the seminal text of guckenheimer & holmes. phil homles (my phd advisor) studied this system in 1982. this simulation is a bit easier to “see” that the static picture appearing in that classic text, but the picture painted by the mathematics is every bit as beautiful & illustrative.

staircase diagrams

i think the best way to begin learning about discrete-time dynamical systems is with the following well-known example. take a calculator; set it to radians; type in a random number; then hit the cosine button over & over. what happens is convvergence to a stable equilibrium. the way the covergence happens is through over- then under-shooting. why? let’s take a look…

staircase diagram for the cosine button-mashing game

for discrete-time 1-d dynamics, the best way to visualize is via a staircase diagram, in which you plot x_{n+1} versus x_n, where x_{n+1} = f(x_n). this allows you to investigate what happens for arbitrary functions f.

staircase diagram with multiple stable and unstable equilibria

if you look closely, you can see the differences between stable and unstable equilibria. of course, more interesting things can happen, but we’ll talk about that later…

1-d maps

dynamical systems come in two flavors — continuous and discrete time. we’ll be covering lots of interesting examples in both settings. but for the moment, it’s worth noting that 1-d discrete-time systems ( or “maps” ) provide a microcosm of what dynamical systems entails.

illustrated below is a staircase diagram of the logistic map, defined by x(n+1) = f(x(n)), where f is a quadratic of the form f(x) = a x ( 1 – x ). as you change the value of the parameter a>0 and the initial condition x(0), then poltting x(n+1) versus x(n) is illuminating. you can see stable and unstable equilibria, periodic orbits of various types, and everything changing. how to make sense of it all? that’s what dynamical systems covers.

joint types, pendula, & configurations

one of the things i loved most in my engineering undergraduate education was learning kinematics — all kinds of cool mechanisms. the pendula that we’ve been looking at have some interesting joints. the planar pendulum has a simple hinge joint, easily built using a high-quality low-friction bearing. the spherical pendulum, on the other hand, has a ball-and-socket joint, which in practice could be effected by a spherical bearing. these are beautiful mechanisms that use lubrication and/or tiny ball bearings to get a nice clean swivel.

sperical joints are lovely…

but this is not the only joint type with multiple degrees of freedom. consider the universal joint, built by fusing two transverse hinges, as illustrated below.

the universal joint

wouldn’t it be fun to simulate a double-pendulum with universal joints and compare it to the analogous system with spherical joints? what a good idea…

double pendulum ; universal joints
double pendulum; universal joints; bottom view

this is so much fun to play with… with the bottom views in particular, you sense that the universal joints give very different behavior than the spherical joints. the universals are more… jerky… constrainted. the spherical joints seem more free.

but are they? are they equivalent in some way? how would you tell? i like to think in terms of the configuration space of a joint (or system of joints). a universal joint has configuration space a 2-dimensional torus (one circle for each hinge joint). of course, this ignores physical constraints such as rigid bars colliding, but there you have it. the spherical joint, on the other hand, as a full SO(3) configuration space, which is three-dimensional, not 2-d like the universal. so, in one sense, this is why a spherical joint “feels” more free. it’s also the reason why a spherical joint cannot transmit torque the way that universal joints can. (universals — or rather pairs of them — are very helpful in automobiles to transmit power from the axles to the wheels…)

the sublime spherical double pendulum

i like pendula in all forms as a way to visualize interesting dynamical systems. i’m most interest in the mathematics behind it all, but occasionally, i let my initial training in mechanical engineering get the best of me. this is one of those times.

consider what happens when you have a double-pendulum, but where the joints are spherical as opposed to planar (or “hinge”) in nature. this is really beautiful.

double spherical pendulum: side view

this can be a little difficult to visualize properly, since there is motion out of the plane of view. let’s take a look at the exacy same simulation, but from below…

double spherical pendulum; from below

ah… that’s a nice double pendulum!

about creating graphics & video

“how do you make these?”
“what software do you use?”

i get asked this on a near-daily basis. usually, i ignore the question or, if feeling guilty, i may say “well, it would take a long time to explain it all, since it’s a really complicated process“. but that leaves people at best wondering and at worst aggressive. so, for the sake of giving people a link where they can get some answers, here it is.

tl; dr: you’re asking the wrong question.

when you ask “what software?” i imagine that you are looking for a magical package for matlab or python or mathematica that makes beautiful graphics. in this case, the short answer is “sorry, does not exist“. if you want to know how i make videos… well, it’s complicated.

  1. it took me years of hard word to learn how to make what i make. you can see my progress, from 2010-2012 using a tablet pc (i loved my fujitusu!) to make the FLCT, to the coursera days of 2012-2013 using nothing but powerpoint to create some really fun animations. i’ve been learning steadily since the Calculus BLUE Project started in may 2015. i’m still not professional-quality, but i’m much better than i used to be. it may take you time to learn also.
  2. i learned most of what i know through watching youtube videos, reading books, and following artists on social media. it only took a few months of input to get to the point where i can quickly tell the difference between the major graphics packages and rendering engines out there by glancing at the end product. if you want to make pro-quality graphics, you will need to use pro-quality software. that means spending money and time. if you don’t know what rendering engine was used, you don’t yet know enough to use it well.
  3. more important than the software packages are the techniques of which design, animation, and compositing are key. i will tell you that i use a blend of powerpoint and adobe tools (AE/PP) to composite my calculus videos. it’s really hard to get those two to play nice together.
  4. i will also tell you that i use a combination of coding (python/julia), game engines (for simulations) and 3-d modeling & rendering engines to build, animate, and simulate systems. that took several years to learn how to do this decently, and, i repeat, i am not at a professional level. i use a mix of different packages, none of which i will endorse (besides powerpoint, which holds a special place in my heart given the scorn it cheerfully endures from others).

so, what should you do if you want to make cool technical animations/videos?

  1. start learning the basics of graphics, starting with perception and color. don’t forget to fill in with good design principles, especially fonts. math/science is plagued with ugly fonts, courtesy of TeX & LaTeX, the tools that saved 20th c. math publishing and doomed 21st c. math publishing to an outdated ugly hell.
  2. pick some simple playground where you can practice doing graphics. my favorite in this category is the processing language, since it is free, fun, and expressive enough to keep you busy. adobe after effects is less programmable, but very powerful 2+1-dimensional software. for fully 3-d, check out the list of available options on wikipedia. pick something with a free version & start learning.
  3. the best way to get good is to produce on a schedule. for a few years. if you think that there’s some magic software that will easily give you good animations, you are misled.

if you’re satisfied, please stop here.

if you want to know more, i’m afraid i’m going to have to be more direct.

\begin{rant}
i teach mathematics and its applications. i do not teach graphics and i definitely don’t teach “how to use software X to make cool thing Y”. what i care about is the mathematics. you might think it’s flattering to ask me “hey, what software?” when i post a video about math. it is not, in a similar way that it is not flattering to ask a mathematician about where she gets her fine shoes or wonderful suits. that is entirely incidental to the professional task at hand, and to focus on the external show as opposed to the intellectual craft is an (unintentional but not unhurtful) insult.

on a related note, please also don’t demand source files, as they will do you no good without commitment to training.
\end{rant}

a spherical pendulum

all of the pendula below are “planar” or have “hinge” joints that constrict motion to a plane. if we replace said hinge joints with a “ball-and-socket” joint, then we have what one calls a spherical pendulum. these have an increased range of motion and lead to some lovely behavior when viewing multiple initial conditions.

a simple spherical pendulum with multiple initial conditions

you might rightly complain that these “spherical” pendula do not take advantage of their increased degrees of freedom. if you look carefully, each pendulum above moves within a single plane. this is a consequence of there being no initial velocity.

let’s change that, and see what motion ensues…

pendula without rods

so what happens if we build a multi-pendulum with structures other than rigid rods? using hoops (solid tori) is especially mesmerizing, and leads one to believe that the dynamics is very different that the rigid-rod case…

a triple pendulum of rings…or is it?

a more careful analysis would show that using rings is equivalent to using rods, as long as you are careful about the equivalent mass (becuase of moment of inertia, the mass of the solid rod and that of the corresponding ring are not the same).

of course, this is be taken to foolish extremes. i do not recommend that you build the following system:

pendumonium

double pendula lead to chaotic dynamics: good. but what happens if we make things a bit more… complicated? what about a triple pendulum? would it be even more chaotic? let’s see…

a triple pendulum: more chaos

well, why stop there? if we take this to a ridiculous extreme, we get ridiculously complicated behavior…

a septuple pendulum. note that the decreasing lengths of the chain elements make it easier to disambiguate different motions. the way in which energy is transferred to the smaller chains is easily visible.

of course, there’s no reason to consider only chains of pendula. the following compound pendulum has multiple bars and ends, and it is one of my favorite things to look at.

a compound pendulum with four “ends”. just look at it!

double pendula & chaos

of course, instead of shaking a pendulum horizontally or vertically, one can go meta and hang a pendulum from a pendulum. let’s see what happens with a such a double pendulum.

a double pendulum

that looks chaotic, doesn’t it? but what is meant by chaos? that takes a long time to learn properly. for now, let’s focus on one crucial requirement for chaos: sensitive dependence on initial conditions. this is the idea that nearby initial conditions diverge in behavior exponentially quickly. let’s take a look:

very very close initial conditions eventually have completely uncorrelated behavior: that’s a hallmark of chaos.

why is the double pendulum chaotic when the single pendulum is not (unless shaken in the right way)? it’s all about topology. the configuration space of a single pendulum is two-dimensional — one for the angle and one for the angular velocity. the configuration space is the tangent bundle of a circle, homeomorphic to an annulus. that’s not enough room for a flow to get chaotic. but the double pendulum has twice the dimension — it’s a 4-d tangent bundle of a torus — and that is plenty of room for chaos to creep in.