Math Insight

Introduction to multi-dimensional discrete systems and matrices

Math 2241, Spring 2023
Name:
ID #:
Due date: Feb. 1, 2023, 11:59 p.m.
Table/group #:
Group members:
Total points: 1
  1. Consider a discrete dynamical system with two state variables, perhaps describing populations sizes of two species. Let's call the state variables $x$ and $y$, and denote their values at the $n$-th time step by $x_{n+1}$ and $y_{n+1}$. Suppose they obey the following (linear) dynamical rule for $n=0, 1, \ldots$ \begin{align*} x_{n+1} &= 3.5 x_{n} - y_{n}\\ y_{n+1} &= x_{n} + y_{n} \end{align*}
    1. If we start with the initial condition $x_0=1$ and $y_0 = 1$, iterate the model for 1 time step to calculate $x_1$ and $y_1$. $x_1= $
      , $y_1=$
    2. Iterate the model for a second time step to calculate that $x_2=$
      and $y_2=$
      .
    3. Starting with the initial condition $(x_0,y_0) = (2,1)$, iterate the model for two times steps to calculate $(x_1,y_1)$ and $(x_2,y_2)$.

      $(x_1,y_1) = $
      , $(x_2,y_2)=$

  2. The general form of the linear discrete dynamical system in two variables can be written as \begin{align*} x_{n+1} &= a x_n + b y_n, \qquad \text{for $n=0,1,2,\ldots$} \\ y_{n+1} &= c x_n + d y_n \end{align*}
    1. 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.

    2. We can use what we know about matrix-vector multiplication to determine what the matrix $A$ must be. When we multiply the matrix $A$ by the vector $(x_n, y_n)$, we want the first component to be the right-hand side of the first equation, $x_{n+1} = a x_n + b y_n$. Similarly, the second component should be the right-hand side of the second equation, $y_{n+1} = c x_n + d y_n$. Enter the appropriate parameters below to specify the components of $A$ and turn the two-dimensional system into a matrix equation.

      $\displaystyle\begin{bmatrix} x_{n+1}\\ y_{n+1} \end{bmatrix}=$




      $\displaystyle\begin{bmatrix} x_{n}\\ y_{n} \end{bmatrix}$

  3. Rewrite the following discrete dynamical systems as matrix equations.
    1. \begin{eqnarray*} u_{n+1} & = & 3u_n+7v_n\\ v_{n+1} & = & 4u_n-3v_n \end{eqnarray*}

      $\displaystyle\begin{bmatrix} u_{n+1}\\ v_{n+1} \end{bmatrix}=$




      $\displaystyle\begin{bmatrix} u_{n}\\ v_{n} \end{bmatrix}$
    2. \begin{eqnarray*} x_{n+1} & = & 2x_n-3y_n+z_n\\ y_{n+1} & = & -x_n+2y_n+4z_n\\ z_{n+1} & = & -3x_n+y_n-2z_n \end{eqnarray*}

      $\displaystyle\begin{bmatrix} x_{n+1}\\ y_{n+1}\\z_{n+1} \end{bmatrix}=$









      $\displaystyle\begin{bmatrix} x_{n}\\ y_{n} \\z_n \end{bmatrix}$
    3. \begin{eqnarray*} x_{n+1} & = & x_n+2y_n-3z_n+4w_n\\ y_{n+1} & = & 2x_n-y_n+2z_n-w_n\\ z_{n+1} & = & 3x_n+2y_n-5z_n+w_n\\ w_{n+1} & = & -x_n+3y_n+2z_n+5w_n \end{eqnarray*}

      $\displaystyle\begin{bmatrix} x_{n+1}\\ y_{n+1}\\z_{n+1}\\w_{n+1} \end{bmatrix}=$
















      $\displaystyle\begin{bmatrix} x_{n}\\ y_{n} \\z_n\\w_n \end{bmatrix}$

  4. One reason to write linear dynamical systems in terms of matrix-vector multiplication is that we can determine the behavior of the dynamical system by analyzing the matrix, as we'll see later. For now, let's just take advantage of the ability of computers to calculate matrix-vector products and use the matrix-vector form of the dynamical system to simulate it.

    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:


    $\displaystyle\begin{bmatrix} x_{n+1}\\ y_{n+1} \end{bmatrix}=$




    $\displaystyle\begin{bmatrix} x_{n}\\ y_{n} \end{bmatrix}$

    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 = $

    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)
    
    
    The first argument is the vector of numbers we want in the matrix and the next two numbers give the matrix dimensions. The argument byrow=TRUE tells R we want to fill the matrix by rows (like in the order you'd read a matrix) rather than down the columns, which is the R default.

    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
    You can then calculate $\vc{x}_2$ by typing the similar command x2 = A %*% x1 in the console. Follow the same pattern to calculate the iteration all the way to $\vc{x}_{10}$.

    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.)

    Two for-loop implementations (Show)

  5. Let $x_t$ and $y_t$ be the population sizes of a particular bird species on two adjacent islands in year $t$. Imagine that each year, due to reproduction, the population size on island 1 increases by 10% percent to $1.1x_t$ and the population on island 2 increases by 20% to $1.2y_t$. After this reproduction, 20% of the birds on island 1 migrate to island 2 and 20% of the birds on island 2 migrate to island 1 (with 80% remaining on their original island). Therefore, the population size in island 1 after a year is $$x_{t+1} = 0.8 \cdot 1.1x_t + 0.2 \cdot 1.2 y_t = 0.88x_t + .24y_t$$ and the population size in island 2 after a year is $$y_{t+1} = 0.2 \cdot 1.1x_t + 0.8 \cdot 1.2 y_t = 0.22x_t + .96y_t$$

    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
    .