Hide help
$(x_1,y_1) = $ , $(x_2,y_2)=$
The one-dimensional analogue of this dynamical system is $z_{n+1}=a z_n$. Since this dynamical rule is multiplying by $a$ at each time step, the behavior of this system is dictated by the magnitude of parameter $a$. If $|a|<$ , then $z_n$ approaches zero as $n$ increases, whereas if $|a|>$ , $|z_n|$ approaches infinity as $n$ increases. We want to find a way to understand the two-dimensional system in a similar way, but we now have four parameters instead of one. What are the four parameters? (Enter the parameters separated by commas.)
The starting point for analyzing the behavior of the two-dimensional system is re-writing it in a format similar to the one-dimensional system. We want to write it as a single equation, where the state variables at time $n+1$ are equal to one “parameter” times the state variables at time $n$. To do this, we use vectors and matrices. We start by writing the state variables as a vector. We will use two formats for writing vectors. Either $$(x_n, y_n)$$ or $$\begin{bmatrix} x_n\\ y_n \end{bmatrix}$$ will denote the vector of state variables. Typically, the first format will be used when we are discussing the vector in isolation. The second format will be used when a matrix is involved.
Our objective is now to write the two-dimensional dynamical system as $$\begin{bmatrix} x_{n+1}\\ y_{n+1} \end{bmatrix}=A\begin{bmatrix} x_n\\ y_n \end{bmatrix}$$ In other words, we want to convert the two-dimensional dynamical system into a matrix equation.
Let's revisit the dynamical system from the first problem. above: \begin{align*} x_{n+1} &= 3.5 x_{n} - y_{n}, \qquad \text{for $n=0,1,2, \ldots$}\\ y_{n+1} &= x_{n} + y_{n} \end{align*} Rewrite this dynamical system in terms of a matrix-vector product:
Let's call this matrix $A$, so that we can write the dynamical system as \begin{gather*} \vc{x}_{n+1} = A\vc{x}_n, \qquad \text{for $n=0,1,2,\ldots$} \end{gather*} where \begin{align*} A = \begin{bmatrix}_&_\\_&_\end{bmatrix} \qquad \text{and} \qquad \vc{x}_n = \begin{bmatrix} x_{n}\\ y_{n} \end{bmatrix}. \end{align*}
The matrix equation $\vc{x}_{n+1} = A \vc{x}_n$ is shorthand for many equations, one for $n=0$, one for $n=1$, etc. The specific versions for $n=0$ and $n=1$ give the equations for $\vc{x}_1$ and $\vc{x}_2$: $\vc{x}_1=$ , $\vc{x}_2 = $
Your answers should just have an A and a $\vc{x}_n$ for a particular value of $n$. Don't actually write out the entries of $A$.
Write $\vc{x}_0$ as x_0.
x_0
The answer is $\vc{x}_1 = A\vc{x}_0$ and something similar for $\vc{x}_2$.
(Hide)
As in the first problem, above, we'll use the initial condition $\vc{x}_0 = \left[\begin{matrix}1\\1\end{matrix}\right]$ to calculate $\vc{x}_1$ and $\vc{x}_2$. This time, since we've rewritten the dynamical system as a matrix-vector multiplication, we can easily ask the computer to do the work for us with the programing language R.
To enter the matrix $A$ in R, type the following command:
A=matrix(c(_, _, _, _), 2, 2, byrow=TRUE)
Once you've entered that command in the console, you can just enter A in the console to view the matrix and make sure it turned out as you expected. R also outputs row and column headings like [,1] to show you the index corresponding to each row and column.
Create the initial condition vector by entering x0 = c(1,1) in the console. The next step is to tell R that we want $\vc{x}_1 = A \vc{x}_0$. Caution: we cannot use the command x1 = A*x0 in R. Instead, in R, A*x0 means to multiply the components of $A$ with the components of $\vc{x}_0$ (recycling the components of $\vc{x}_0$ since there are fewer components). The correct command for calculating $\vc{x}_1$ in R is
x1 = A %*% x0
The result is: $\vc{x}_1 =$ , $\vc{x}_2 =$ , $\vc{x}_{10} =$ (If you are adventurous, you could try computing $\vc{x}_{10}$ using a for-loop, though it isn't that laborious to just type the required 10 equations, especially since you can hit the up-arrow in the R console to bring back the previous command, edit it, and run the new version.)
If you don't mind throwing out intermediate values of $\vc{x}_n$ and just keeping the last value $\vc{x}_{10}$, you could have just used one R variable x to iterate the system. To begin, set x to the initial condition by typing x = c(1,1) in R. After this step, the R variable x holds the value of $\vc{x}_0$. Next, enter x = A %*% x to overwrite the R variable x so that it holds the value of $\vc{x}_1 = A \vc{x}_0$. Repeat the command x = A %*% x and x holds the value of $\vc{x}_2$. Repeat the command x = A %*% x eight more times, and x holds the value of $\vc{x}_{10}$.
x
x = c(1,1)
x = A %*% x
Rather than typing x = A %*% x ten times, you could create a for-loop to repeat the command automatically. As before, enter x = c(1,1) to set the initial condition, then use the following for-loop to type x = A %*% x ten times for you.
for(i in 1:10) { x = A %*% x }
If you want to save all the value of $\vc{x}_n$ for $n=0,1, \ldots, 10$ and use a for-loop, you can let x be a $2 \times 11$ matrix (i.e., with 2 rows and 11 columns) with this command. x = matrix(0, nrow=2, ncol=11) After this command, the R variable x is a matrix of all zeros. In R, you can refer to the first column of x as x[,1]. Therefore, the command x[,1] = c(1,1) sets the first column to the initial condition $\vc{x}_0$. To make column x[,i+1] be $\vc{x}_i$ for $i=0,1, \ldots 10$, execute this for-loop.
x = matrix(0, nrow=2, ncol=11)
x[,1]
x[,1] = c(1,1)
x[,i+1]
for(i in 0:9) { x[,i+2] = A %*% x[,i+1] }
If in year 0, the population sizes are $x_0=176$, $y_0=44$, calculate the population sizes after 5, 10, and 20 years. $x_5 =$ , $y_5 =$ $x_{10} =$ , $y_{10} =$ $x_{20} =$ , $y_{20} =$
For each year, determine what fraction of the birds are on each island. Year 0. Fraction on island 1: . Fraction on island 2: . Year 5. Fraction on island 1: . Fraction on island 2: . Year 10. Fraction on island 1: . Fraction on island 2: . Year 20. Fraction on island 1: . Fraction on island 2: .
After a long time, the fraction on each island appears to blow up to large values oscillate approach a constant value decay to zero.
The simplest way to iterate the system is to first convert it to a matrix equation.
Then, one can enter the matrix in R by typing the following command:
If you create the initial condition vector $\vc{x}_0 = (x_0,y_0)$ with R command x0 = c(, )
x0 = c(
,
)
then one way to calculate $\vc{x}_5=(x_5,y_5)$ is with the for-loop
x5=x0 for(i in 1:5) { x5 = A %*% x5 }
This loop simply multiples the vector $\vc{x}_0$ on the left by $A$ five times, corresponding to iterating the system five time steps.