Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Public worksheets for UCLA's Mathematics for Life Scientists course
Recall the black bear population model:
The interactive below shows its behavior. As usual, to use interactives in this worksheet, click “Open in CoCalc” at the top right of this page.
Below is another interactive showing what happens to states along the eigenvector lines, including states in the other three quadrants. Even though this is biologically meaningless, it will help us to understand the overall behavior of the system.
Diagonal matrices:
Growth along one axis, decay along the other:
First look at what happens just along the axes.
Now, see what happens when you put both together.
Note that the behavior above shows that the equilibrium point at the origin is a saddle point.
Note also that the long-term behavior is growth along the axis, because that is the axis that has exponential growth, caused by the larger eigenvalue 1.2.
Growth along both axes:
In the case above, we see that the equilibrium point at the origin is unstable (a source). This should not be surprising at all.
More importantly, we also see that, although both the and are increasing (and will increase exponentially forever), the long-term behavior is primarily growth in the direction, because this axis has the faster exponential growth rate. Again, that faster growth rate is due to the larger of the two eigenvalues, 1.3.
Decay along both axes
Again, it should not be surprising that the above equilibrium point is stable (a sink).
More importantly, in the above case we see that, although both and are decaying exponentially, the trajectories always eventually approach the origin (equilibrium point) along the axis. So the long-term behavior is exponential decay (at 10% per iteration) along the axis. This time, this is caused by the fact that the axis has the slower of the two decay rates. But the slower of the two decay rates still means the larger of the two eigenvalues!
Important conclusion!
In all of the cases above, the conclusion was that the larger of the two eigenvalues determined the long-term behavior of the system. This largest eigenvalue is called the dominant eigenvalue. Actually, since the exponential growth/decay rates are determined by the absolute value of the corresponding eigenvalue, the dominant eigenvalue is the one whose abolute value is largest. To be more specific about its meaning:
This dominant eigenvalue determines the long-term growth (or decay) rate of the system, and
That growing (or decaying) in the long run will be primarily in the direction of (i.e. parallel to) the axis that corresponds to that eigenvalue.
Coordinates
First, standard coordinates
Coordinates with respect to a different basis:
Putting it all together...
The black bear population model again, using the new “-coordinates”
Note that in the black bear population model, the eigenvectors of the matrix were exactly the same vectors and that we used just now to define the -coordinate system. The eigenvalue corresponding to was 1.15, and the eigenvalue corresponding to was 0.4.
First, a reminder of what that means about exponential growth/decay along the eigenvector lines:
Now, explore how those other trajectories (that don't just start on the eigenvector lines) happen:
Be sure to click the “show projections” checkbox after simulating one of the trajectories.
You can also uncomment other initial conditions (find “ics” in the code) to see other trajectories.
The above simulation(s) show the point of diagonalizing a matrix:
When you treat the system entirely in the -coordinate system defined by the eigenvectors, the matrix becomes diagonal, which means that the behavior of the entire system can be understood just like for a diagonal matrix. The only difference is that instead of thinking in terms of -coordinates, and all the growth and decay happening along the and axes, now everything in the state space must be handled in the -coordinate system, and all the exponential growth/decay happens along the axes of the that coordinate system... which are the eigenvector lines.
In particular, this means that everything we said above about the dominant eigenvector, and the types of equilibrium point at the origin, all carry over to arbitrary matrices, not just diagonal ones.
Examples of diagonalizing
Black bear population model:
Mares and fillies model from Midterm 2:
Lionfish model from lab:
This one is 3-dimensional, but diagonalization still works the same way.
What about complex eigenvalues?
Here is a 3-dimensional model that has a pair of complex eigenvalues. Recall that complex eigenvalues give rise to rotating/oscillating behavior (usually combined with exponential growth (spiralling outward) or exponential decay (spiralling inward), depending on whether the absolute value of those eigenvalues is greater than or less than 1).
One way of handling this: just use the complex eigenvectors
This diagonalizes the matrix perfectly, as usual. But what does it really tell us about where the trajectories will go and how they will behave?
Perhaps a better way:
Take one of the complex eigenvectors (it doesn't matter which one, since they're complex conjugates of each other) and separate its real and imaginary parts into two separate vectors. Use these to form the columns of the transformation matrix . Now look what happens...
This matrix is not diagonal, but it is close: it is called a “block diagonal” matrix. The 2×2 “block” that appears in the upper left part of the matrix has the form where the and are exactly the real and imaginary parts of the complex eigenvalues of our original matrix! The eigenvalues of this 2x2 block, by itself, are also exactly and , the same as those of our original matrix.
A 2×2 matrix of this form, , as a discrete-time linear model, will have trajectories that rotate/oscillate around the origin, as they exponentially grow (spiral outward) or exponentially decay (spiral inward). Once again, whether they grow or decay, and how fast, depends on the value of ... which is just the absolute value of the two complex eigenvalues. Note that in our example,
so this 2×2 block will cause spiralling inward.
What does all of the above mean for the behavior of our original 3×3 matrix ? The matrix given above still works as a transformation matrix that converts between coordinate systems, in the usual way: the columns of are a basis (of ), and this basis defines a new coordinate system, which we might call -coordinates. What the block-diagonal form of means is that in the -plane in this coordinate system, trajectories will spiral inward. Along the axis, trajectories will exponentially grow (at 10% per iteration). Everywhere else in the state space, the behavior will be a combination of these two features, just as we've seen in all the previous examples. Here is a 3-D rendering of this, showing the -plane (in green), the -axis (in red), and a typical trajectory that starts close to the -plane. This is one version of a 3-dimensional saddle point, one that includes rotating/spiralling behavior.