45  Eigenvalues, eigenvectors

WebR Status

🟡 Loading...

In the previous chapters, you’ve seen how linear dynamics, when unstable, lead trajectories off to infinity. 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

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 v. The driver sets a desired speed, which we will call v0. The cruise control actuator—the mechanism that works to maintain the speed at v0 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 v from the set speed v0. throttle-input=a(vv0) . You can see that when v=v0, the throttle input from the system is zero. When v0<v, 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 tv: positive input increases speed, negative input decreases speed. The overall system is then described by a linear, first-order differential equation tv=a(vv0) . This equation has a fixed point at v=v0 (as desired). To describe more simply the dynamics around the fixed point, we can define a new dynamical state y=vv0. Differentiating both sides with respect to time gives ty=tv, so we can re-write the original differential equation as ty=ay which has a solution y(t)=Aeat as we’ve seen before. For any positive coefficient a, the control system is stable: a deviation from v0 will be followed by exponential decay back to v0.

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 x and define “too close” to mean closer than distance x0. The car is traveling at velocity v and the car in front at vf. If vf<v, the distance between the cars gets smaller: tx=(vvf). On the other hand, if x0<x, the car is far enough away that the velocity can be increased: tv=b(xx0). We can unite these two first-order differential equations into a single, second-order equation: tx=(vvf)    ttx=tv=b(xx0) To solve this system, define yxx0. This implies tty=ttx, so the equation describing the control system becomes tty=by . The solution to this is y(t)=Asin(b t) 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 tx=ax+byty=cx+dy .

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 x and y components of the state into a vector, w(t)=[x(t)y(t)] . The differential equation, in terms of w(t) is tw(t)=[abcd]w(t) . Now imagine that we pick two non-colinear vectors, u1 and u2 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: w(0)=[x(0)y(0)]=m1u1+m2u2 .

For the moment, we won’t worry about how best to choose u1 and u2; any two vectors that are not colinear will do.

As a running example, we will work with the pair of first-order differential equations tx=x+yty=2x , which, in vector/matrix form are tw(t)=[1120]w(t) . Imagine that we choose, arbitrarily, u1=[13]   and   u2=[1.00] .

For the example, we will calculate a trajectory starting at the initial condition w(0)=[1.12.1]:

traj <- integrateODE(dx ~ x + y, dy ~ 2*x, # dynamics
                     x=-1.1, y=2.1, # initial conditions
                     domain(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 vecu1 and vecu2 and the flow field.

The initial condition (marked “0” in is, like any other point in the state space, a linear combination of u1 and u2. 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():

So, w(0)=0.7u10.4u2. Keep these scalar coefficients, 0.7 and 0.4 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 u1 as the initial condition and, similarly, using u2 as the initial condition.

traj_u1 <- integrateODE(
  dx ~ x + y, dy ~ 2*x, # dynamics
  x=1, y=-3,  #initial conditions
  domain(t = 0:2))
traj_u2 <- integrateODE(
  dx ~ x + y, dy ~ 2*x, #dynamics
  x=1, y= 0,  #initial conditions
  domain(t = 0:2))

shows these trajectories.

## 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 u1 and u2.

At first glance, the two trajectories u1(t) and u2(t) in that start from u1 and u2 might not look much like the trajectory in that starts from w(0)=0.7u10.4u2. But in fact there is a very simple relationship between the trajectories: w(t)=0.7u1(t)0.4u2(t) . To state the situation more generally, any solution to the differential equations can be written as a linear combination of the solutions starting at u1 and u2, regardless of how u1 and u2 were chosen.

We can see this algebraically. Since u1(t) and u2(t) are solutions to the linear differential equation, it must be that tu1(t)=[1120]u1(t)  and  tu2(t)=[1120]u2(t) . Taking a linear combination of these equations gives
t[m1u1(t)+m2u2(t)]=[1120][m1u1(t)+m2u2(t)] The same will be true in general, that is, for the matrix [abcd].

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 m1u1(t)+m2u2(t), where u1(t) is the solution starting at an initial condition u1 and u2(t) is the solution starting at u2. It does not matter how u1 and u2 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 u1 and u2 that makes the solutions u1(t) and u2(t) have a very simple, purely exponential format. The vectors to be chosen are the eigenvectors of the matrix [abcd]. We will call these eigenvectors Λ1 and Λ2. (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 Λ1 and Λ2 and that the solutions Λ1(t) and Λ2(t) are in fact simple exponentials. derives the formula for the eigenvectors. Here, we use the R function eigen() to do the calculations for us.

Calculating eigenvectors

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 tx=x+yty=2x      the matrix is, as we’ve seen, [1120] .

Carrying out the eigenvector calculation is straightforward:

The eigenvectors are the two columns of the matrix labeled vectors returned by the calculation. Here, that is
Λ1=[0.70710.7071]   and    Λ2=[0.44720.8944] .

The calculation also produces eigenvalues. Here that is λ1=2 and λ2=1.

We can see what’s special about Λ1 and Λ2 by plotting them along with the flow field, as in .

Figure 45.3: The eigenvectors for the [1120] 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 Λ1 is away from the fixed point, while the flow along the subspace of Λ2 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 m1Λ1 will have the form m1(t)Λ1 and similarly for an initial condition m2(t)Λ2.

As we did in the previous section, let’s calculate the trajectories Λ1(t) and Λ2(t) starting at the two eigenvectors and plot out the y(t) 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,  # dynamics
  x = 0.7071, y = 0.7071, # initial conditions
  domain(t = 0:1) 
  )
## Solution containing functions x(t), y(t).
traj_eigen2 <- integrateODE(
  dx ~ x + y, dy ~ 2*x,  # dynamics
  x=-0.4472, y=0.8944,   # initial conditions
  domain(t = 0:1))
## Solution containing functions x(t), y(t).
traj_plot(y(t) ~ t, traj_eigen1, color="magenta") |>
 traj_plot(y(t) ~ t, traj_eigen2, color="blue") |> 
  gf_refine(scale_y_log10(
    breaks=c(0.3290, 0.7071, 0.8944, 5.2248)))

Figure 45.4: Two time series, one showing stability, the other instability.

We have marked the y axis with the starting and ending values of each function, so that you can find the exponential parameter k for each function.

y1(t)=0.7071ek1t

y2(t)=0.8944ek2t.

To find k1 and k2, plug in t=1 to the solution:

y1(1)=5.2248=0.7071ek1k1=2

y2(1)=0.3290=0.8944ek2k2=1

Look back at the results from the eigen(M) calculation. These values for k1 and k2 are exactly the eigenvalues that were computed from the matrix M. In standard notation, rather than k1 and k2, the notation λ1=k1 and λ2=k2 is preferred. (Remember, λ is the Greek letter “lambda” in it is lower-case form.) Every solution to the differential equation has the form m1eλ1tΛ1+m2eλ2tΛ2 . The scalar coefficients m1 and m2 can be found from the initial condition. The stability of the system depends only on λ1 and λ2. If either one of these is positive, then the system is unstable.

×

R History Command Contents

Download R History File