wcf/GTWeb

UAR Lect. 2 - Nonlinear Dynamical Systems

Steve Strogatz teaches nonlinear dynamics and chaos at Cornell. He explains dynamical systems graphically, and this is the style that Russ is going for (related to graphical depiction of gradient descent).

Let our system be a simple pendulum with end point mass , length , CCW angle from vertical (pointing down) , and gravity .

Kinetic energy

Potential energy

Lagrangian mechanics gets (Here, which is a force related to the pendulum torque ).

By adding simple damping/friction, .

where is the damping term. (This is known as "viscous damping"; similar to a dashpot.)

This emulates the form:

Given the initial state , we should be able to get , but the fact is that there exists a within this equation means that it is no longer a linear differential equation ( where each term is a derivative of ). Trigonometry is nonlinear.

"Most of our interesting robots have nonlinearities."

The difficulty of nonlinearity is mainly time-based. Finding (what a system will stabilize to) and whether a certain state will be visited (perhaps a failure state) is much easier than finding . These are the concepts of stability and reachability, respectively, which we will visit using graphical analysis.

There is a dynamical regime, with high damping, in which a first-order model of an inverted pendulum can be accurate.

has units and has units . The only thing separating them is an .

The natural frequency of a pendulum is with units because it is a frequency. This can be considered our . Therefore, one can specify the heavily-damped regime of the pendulum as , which are dimensionally-comparable quantities.

Knowing that is so small allows us to approximate our system:

Becomes

mgl -|     
     |
-----+\-------------------------+
     | \           <--flow     /  
     |  \                     /  
     |   `.                 ,'
     |     `.             ,'
     |       `-.       ,-'
-mgl-|          `-,,,-'

Left flow because .

We want the system to be perfectly as we desire, such that the control term is zero. This helps if the state is , so that's one of our points. All x-intercepts are "fixed points" that are stable.

If we apply a constant torque to , oddly, the fixed points will come together. Above the x-axis, we go right. Below, we go left. They will eventually converge to the middle point.

The area which moves the system to a particular fixed point is known as the region of attraction.

"A linear system can only be stable at the origin." A fixed point is only "locally stable." In a linear system, only the origin is "globally stable."

Some Defns of Stability

Local stability in the sense of [[Lyapunov function|Lyapunov]] ("i.s.L.")

  • If you start near the region, you won't go too far from the region. (You won't leave a certain ball of space.)

Locally attractive

  • Will converge to a region by time.

Asymptotically stable

  • Attractive + i.s.L.

Exponentially stable

  • There's a rate at which the system gets to convergence with some constant.

An undamped pendulum with a slight amount of swinging will be stable i.s.L. as it never leaves its "ball", but it will not be stable in the asymptotic/exponential senses.

Formal defns:

i.s.L.

For every , s.t. within a delta ball of the fixed point , then this implies that you will never leave the epsilon ball, .

We start within the delta ball. Therefore, we'll surely be within the less-rigorous epsilon ball.

"The local invariant sets may not be circular." (?)

Locally attractive

You can be attractive but not i.s.L., such as an orbiting position that never stabilizes at the globally-stable point .

Asymptotically stable

i.s.L. && locally attractive

Exponentially stable

We have a linear system , and the difference from the attractor will converge faster than the linear system.

Neural networks

Let us look at the dynamics of a simple recurrent neural network ([[RNN]]), recurrent in that it is a looped process.

An input comes in, weighted by , and processed through nonlinear dynamics (in this case, a function ), and it is run through the process again.

A single-neuron RNN is called an autapse. We find them when growing neurons in a dish who have nothing to attach to.

This looks like , but tangent to and instead of and .

If , we can already see that the whole system would become quite stable.

At the first positive hump, our increases so as to push us rightwards. Thus the pattern.

Viewing the arrows allows you to see that there are stable points at .

The autapse can be used to represent memory because its bistability can be affected by an input , making it so that it permanently holds the data of what its input was.

We can add a "forgetting term" using .

When we talk about optimization in a neural network, one may say that "all minima are global minima" in the case of fixed points and autapses.

A Hopfield network has multiple fixed points, each one being associated with a certain memory. You can program the neural network to have fixed points wherever you want to store different states, I suppose.

Because each state (e.g. an image) is a fixed point, there exists a "region of attraction" such that merely getting close to the image in pixel space will pull you into the full image. Dynamics makes this transition.

Mid-Lecture Reflection

There is clearly more I need to research in the fundamentals of learning and dynamical systems in order to make fundamental advances in robotic dynamics. I am seeing what Russ means by saying that the various approaches are more similar than different, i.e. they are all dynamical systems that can be analyzed to determine what things are stable. Hopefully for the future, we can better utilize probabilistic estimations of stability for safe robotics.

Second-Order Systems

They (2D phase portraits) are a little harder to graphically analyze.

is our time-dependent system.

How the state-space phase portrait differs from the typical depiction of the phase space is that we use position and velocity, not position in momentum (the latter is more common in physics).

When this is plotted, it becomes apparent that the system has a patterned, almost-circular trajectory throughout the state space, which sort of looks like several eyeballs.1

We can see that, because it is circular, it is Lyapunov stable because it does not move outside of our epsilon ball (the eyeball), but it is not asymptotically stable.

Along the homoclinic curves, there is a constant energy of . If you start with too much energy, you go counterclockwise, just like an inverted pendulum failing to balance with too much speed. If you start with too little energy, you go counterclockwise like an inverted pendulum with not enough speed. With the wrong amounts of energy, we spiral into the asymptotically-stable attractor.

In summary: you can learn a lot by looking at the phase portraits, especially by plotting the optimal control algorithms on top of them to watch how they work with the dynamics.

Our goal with controls is to change the vector field with . It doesn't let us change what direction we go in at a certain point, but we can slightly change the magnitudes of the vectors.

"What's the minimal change in the vector field that reflows the dynamics in the way we want?" We don't want to make drastic changes, as that does not respect the physics and instead replaces it.

We will use optimization and machine learning to shape the controlled system as we desire.

Footnotes

Footnotes

  1. Note that the second-order phase portrait has no non-Euclidean manifolds because we're leaving out . loops between and 0, as you know.