Prompt for April 19

Linear Algebra: How do matrices work? Do they work on coordinates?? Let's find out!

Here is a neat interactive tool for eigenvectors and eigenvalues.

Example System

Here is a simple dynamical system that describes the relationship between coyotes and roadrunners in a fictional country:

c(t+1) r(t+1) = 0.86c(t) -0.12c(t) 0.08r(t) 1.14r(t) = 0.86 -0.12 0.08 1.14 * c(t) r(t)

The matrix [(]c(t), r(t)] is a state vector, telling us everything we need to know about the system
The 2x2 matrix encodes all we need to do to the matrix in order to compute the following year's state vector

We can apply the matrix again and again to compute additional years, which can get a bit tedious

c(0) r(0) = 0 100 100 -> 1 94 102 -> 2 89 105 . . . 10 ~80 ~170

Let's plot out the stepwise changes from an initial state

c(t) r(t) c(t) r(t) X1 X2 Y1 Y2 = (Note: floating point errors are common) c(t+1) r(t+1)

Something interesting happens if we pick a specific starting state vector

c(0) r(0) = 0 100 300 -> 1 110 330 -> 2 121 363 . . . 10 ~259 ~778

Each iteration, the state actually increases by a fixed amount! Step 1 is (1.1 * step0), Step 2 is (1.1*1.1 * step0)

Step N is then (1.1^n * step0)
For these special initial state vectors, we don't need the transformation matrix at all!

These special initial state vectors are called eigenvectors. The fixed amount of increase, 1.1, is the eigenvalue.
This transformation matrix has two of them: [100,300] and [200,100].

Eigenvectors give you one key benefit: Because they describe a consistent "line" moving from [0,0], you can use them to compute c(t) and r(t) for other state vectors!

1000 1000 = s_1 * 100 300 + s_2 * 200 100 1000 = (s_1 * 100) + (s_2 * 200) 1000 = (s_1 * 300) + (s_2 * 100)

We have a simple system of equations, which can be solved via substitution for s_1 and s_2. Eventually, we find s_1=2 and s_2=4, meaning that the initial state vector [1000,1000] can be represented using the two eigenvectors for the system.

We can then use the formula for eigenvectors to solve for a particular time, t

2 * (1.1)^t * 100 300 + 4 * (0.9)^t * 200 100 c(t) = (1.1^t) * 200 + (0.9^t) * 800 r(t) = (1.1^t) * 600 + (0.9^t) * 400

Using these formulas to draw a line graph...

c(t) r(t)

And now drawing lines for many different combinations of s_1 and s_2!

c(t) r(t)

Note: This code does not make eigenvectors have a length of 1. This is generally done by convention.

Code for today: