In the previous chapters, you’ve seen how linear dynamics, when unstable, lead trajectories off to infinity. Chapter 43 looked at some ways that nonlinearity can tame instability, as in the simple models of linear growth.
In this chapter, we return to linear dynamics to develop a quantitative theory of stability. Such theory is important in many engineering and design applications. For instance, a building exposed to earthquake risk can be economically designed to be strong specifically against the type of shaking produced by earthquakes. An electronic circuit can be designed to be sensitive to certain kinds of communication signals while still resisting noise or jamming.
Cruise control is a feature of many modern automobiles. It enables a driver to set a desired speed for the car to follow automatically, thus reducing cognitive load on the driver. Early models of cruise control introduced in the 1970s (and still common in 2020) had an extremely simple logic. The speedometer constantly monitors the car’s speed . The driver sets a desired speed, which we will call . The cruise control actuator—the mechanism that works to maintain the speed at by, let’s say, adjusting the throttle to increase or reduce speed as appropriate—is designed to produce a throttle input proportional to the deviation in actual speed from the set speed . You can see that when , the throttle input from the system is zero. When , as when starting to go downhill, the throttle input will be negative, reducing the speed.
A simple model is that the throttle input is proportional to : positive input increases speed, negative input decreases speed. The overall system is then described by a linear, first-order differential equation This equation has a fixed point at (as desired). To describe more simply the dynamics around the fixed point, we can define a new dynamical state . Differentiating both sides with respect to time gives , so we can re-write the original differential equation as which has a solution as we’ve seen before. For any positive coefficient , the control system is stable: a deviation from will be followed by exponential decay back to .
A modern cruise control system adds an important feature: the car slows down automatically if it gets too close to the car in front. Let’s call the distance to the leading car and define “too close” to mean closer than distance . The car is traveling at velocity and the car in front at . If , the distance between the cars gets smaller: . On the other hand, if , the car is far enough away that the velocity can be increased: . We can unite these two first-order differential equations into a single, second-order equation: To solve this system, define . This implies , so the equation describing the control system becomes The solution to this is as you can confirm by substitution.
Result: The simple car-following control system oscillates. That is not a very good experience for the driver! By constructing a theory of stability, we may be able to figure out a re-design that will cause the oscillations to go away.
45.1 Vector solutions to linear differential equations
The form in which we have been writing linear differential equations in two state variables is
A key part of constructing a theory of stability is finding a set of mathematical ideas that enable us to view dynamics in a simpler way. The idea we will introduce here is thinking about the state and trajectory of a differential equation using vectors. We will work here with systems with a two-variable dynamical state, but the results apply just as well to higher dimensional states. That is important in applied work, where the systems being modeled are complicated with many state components.
We can re-write the linear differential equation using vector and matrix notation. Suppose that we collect the and components of the state into a vector, The differential equation, in terms of is Now imagine that we pick two non-colinear vectors, and that span the state space. Since the vectors are assumed to span the state, any initial condition can be written as a linear combination of those two vectors:
For the moment, we won’t worry about how best to choose and ; any two vectors that are not colinear will do.
As a running example, we will work with the pair of first-order differential equations which, in vector/matrix form are Imagine that we choose, arbitrarily,
For the example, we will calculate a trajectory starting at the initial condition :
traj <-integrateODE(dx ~ x + y, dy ~2*x, # dynamicsx=-1.1, y=2.1, # initial conditionsdomain(t=0:2))traj_plot(y(t) ~x(t), traj)
## Warning: All aesthetics have length 1, but the data has 500 rows.
## ℹ Please consider using `annotate()` or provide this layer with data containing
## a single row.
## All aesthetics have length 1, but the data has 500 rows.
## ℹ Please consider using `annotate()` or provide this layer with data containing
## a single row.
Figure 45.1: The trajectory calculated starting at (-1.1, 2.1). The graph is annotated with the vectors and and the flow field.
The initial condition (marked “0” in Figure 45.1 is, like any other point in the state space, a linear combination of and . We can find the scalar coefficients of the linear combination using any of the methods presented in Block 5, for instance the telescope method. We will illustrate with qr.solve():
1
2
3
M <- cbind(rbind(1,-3), rbind(1,0))
w0 <- rbind(-1.1, 2.1)
qr.solve(M, w0)
So, . Keep these scalar coefficients, and in mind for the next example.
We can use integrateODE() to find the solution starting at any initial condition. In particular, we can find the solution as the initial condition and, similarly, using as the initial condition.
traj_u1 <-integrateODE( dx ~ x + y, dy ~2*x, # dynamicsx=1, y=-3, #initial conditionsdomain(t =0:2))traj_u2 <-integrateODE( dx ~ x + y, dy ~2*x, #dynamicsx=1, y=0, #initial conditionsdomain(t =0:2))
## Warning: All aesthetics have length 1, but the data has 500 rows.
## ℹ Please consider using `annotate()` or provide this layer with data containing
## a single row.
## All aesthetics have length 1, but the data has 500 rows.
## ℹ Please consider using `annotate()` or provide this layer with data containing
## a single row.
Figure 45.2: Trajectories from the initial conditions and .
At first glance, the two trajectories and in Figure 45.2 that start from and might not look much like the trajectory in Figure 45.1 that starts from . But in fact there is a very simple relationship between the trajectories: To state the situation more generally, any solution to the differential equations can be written as a linear combination of the solutions starting at and , regardless of how and were chosen.
We can see this algebraically. Since and are solutions to the linear differential equation, it must be that Taking a linear combination of these equations gives The same will be true in general, that is, for the matrix .
45.2 Eigenvectors and eigenvalues
In the previous section, we saw that the solution to any linear differential equation starting at any initial condition can be written as a linear combination , where is the solution starting at an initial condition and is the solution starting at . It does not matter how and are chosen, so long as they are not colinear, that is, so long as they span the state space.
In this section, we demonstrate that there is a particular way of selecting and that makes the solutions and have a very simple, purely exponential format. The vectors to be chosen are the eigenvectors of the matrix . We will call these eigenvectors and . (This use of the Greek letter (capital “lambda”) and it is lower-case version , is conventional in mathematics, physics, and engineering. So it is worth learning to identify the letters.)
Our task in this section is to show how to compute the eigenvectors and and that the solutions and are in fact simple exponentials. Chapter 46 derives the formula for the eigenvectors. Here, we use the R function eigen() to do the calculations for us.
Eigenvectors can be calculated using the R function eigen() applied to the abcd matrix that defines the linear differential equation.
For the system of first-order differential equations the matrix is, as we’ve seen,
Carrying out the eigenvector calculation is straightforward:
1
2
M <- cbind(rbind(1,2), rbind(1,0))
eigen(M)
The eigenvectors are the two columns of the matrix labeled vectors returned by the calculation. Here, that is
The calculation also produces eigenvalues. Here that is and .
We can see what’s special about and by plotting them along with the flow field, as in Figure 45.3.
Figure 45.3: The eigenvectors for the plotted along with the flow.
The eigenvectors mark the directions where the flow is either directly toward the fixed point or directly away from it. Here, the flow on the subspace of is away from the fixed point, while the flow along the subspace of is inward to the fixed point.
The consequence of this alignment of the flow with the eigenvectors is that the trajectory from any initial condition will have the form and similarly for an initial condition .
As we did in the previous section, let’s calculate the trajectories and starting at the two eigenvectors and plot out the component of the solution. Since we are anticipating an exponential form for the function, we use semi-log axes, where an exponential looks like a straight line.
traj_eigen1 <-integrateODE( dx ~ x + y, dy ~2*x, # dynamicsx =0.7071, y =0.7071, # initial conditionsdomain(t =0:1) )## Solution containing functions x(t), y(t).traj_eigen2 <-integrateODE( dx ~ x + y, dy ~2*x, # dynamicsx=-0.4472, y=0.8944, # initial conditionsdomain(t =0:1))## Solution containing functions x(t), y(t).
Figure 45.4: Two time series, one showing stability, the other instability.
We have marked the axis with the starting and ending values of each function, so that you can find the exponential parameter for each function.
.
To find and , plug in to the solution:
Look back at the results from the eigen(M) calculation. These values for and are exactly the eigenvalues that were computed from the matrix M. In standard notation, rather than and , the notation and is preferred. (Remember, is the Greek letter “lambda” in it is lower-case form.) Every solution to the differential equation has the form The scalar coefficients and can be found from the initial condition. The stability of the system depends only on and . If either one of these is positive, then the system is unstable.