Link to this document's Jupyter Notebook

In order to successfully complete this assignment you must do the required reading, watch the provided videos and complete all instructions. The embedded survey form must be entirely filled out and submitted on or before 11:59pm on on the day before class. Students must come to class the next day prepared to discuss the material covered in this assignment.


Readings for this topic (Recommended in bold)

Pre-Class Assignment: Linear Dynamical Systems

Goals for today's pre-class assignment

  1. Linear Dynamical Systems
  2. Markov Models
  3. Ordinary Differential Equations
  4. Assignment wrap up

1. Linear Dynamical Systems

A linear dynamical system is a simple model of how a system changes with time. These systems can be represented by the following "dynamics" or "update equation":

$$x_(t+1) = A_tx_t$$

Where $t$ is an integer representing th progress of time and $A_t$ are an $n \times n$ matrix called the dynamics matrices. Often the above matrix does not change with $t$. In this case the system is called "time-invariant".

We have seen a few "time-invarient" examples in class.

DO THIS: Review Chapter 9 in the Boyd and Vandenberghe text and become familiar with the contents and the basic terminology.


2. Markov Models

This is not the first time we have used Dynamical Linear Systems.

DO THIS: Review markov models in 10--Eigenproblems_pre-class-assignment.ipynb. See how this is a special type of linear dynamical systems that work with state probabilities.

Example

The dynamics of infection and the spread of an epidemic can be modeled as a linear dynamical system.

We count the fraction of the population in the following four groups:

We denote the fractions of these four groups in $x(t)$. For example $x(t)=(0.8,0.1,0.05,0.05)$ means that at day $t$, 80\% of the population are susceptible, 10% are infected, 5% are recovered and immuned, and 5% died.

We choose a simple model here. After each day,

Do this: Write the dynamics matrix for the abovde makov linear dynamical system. And come to class ready to discuss the matrix. (hint the columns of the matrix should add to 1).

Do this: Review how we solved for the long term steady state of the markov system. See if you can find these probabilities for your dyamics matrix.


3. Ordinary Differential Equations

Ordinary Differential Equations (ODEs) are yet another for of linear dynamical systems and are a scientific model used in a wide range of problems of the basic form:

$$\dot{x} = A x$$

These are equations such that the is the instantaneous rate of change in $x$ (i.e. $\dot{x}$ is the derivative of $x$) is dependent on $x$. Many systems can be modeled with these types of equations.

Here is a quick video that introduces the concepts of Differential Equations. The following is a good review of general ODEs.

Now consider an ODE as a system of linear equations:

$$\dot{x_t} = A x_t$$

Based on the current $x$ vector at time $t$ and the matrix $A$, we can calculate the derivative at $\dot{x}$ at time $t$. Once we know the derivative, we can increment the time to by some small amount $dt$ and calculate a new value of $x$ as follows:

$$x_{t+1} = x_t + \dot{x_t}dt$$

Then we can do the exact sequence of calculations again for $t+2$. The following function has the transition matrix ($A$), the starting state vector ($x_0$) and a number of time steps ($N$) and uses the above equations to calculate each state and return all of the $x$ statues:

The following code generates a trajectory of points starting from x_0, applying the matrix $A$ to get $x_1$ and then applying $A$ again to see how the system progresses from the start state.

For example the following code uses the matrix $A= \begin{bmatrix}1 & 1 \\ 1 & -2\end{bmatrix}$ and the starting point (0,0) over 50 timesteps to get a graph:

Do this: Let $$A= \begin{bmatrix}2 & 3 \\ 4 & -2\end{bmatrix}$$

Write a loop over the points $(1.5,1)$, $(-1.5,-1)$, $(-1,2)$ and plot the results of the traj function:

Do this: Let $$A= \begin{bmatrix}6 & -1 \\ 1 & 4\end{bmatrix}$$

Write a loop over the points $(1.5,1)$, $(-1.5,-1)$, $(-1,2)$, $(1,-2)$ and $(2,-2)$ and plot the results of the traj function:

Do this: Let $$A= \begin{bmatrix}5 & 2 \\ -4 & 1\end{bmatrix}$$

Write a loop over the points $(1.5,1)$, $(-1.5,-1)$, $(-1,2)$, $(1,-2)$ and $(2,-2)$ and plot the results of the traj function:


4. Assignment wrap up

Please fill out the form that appears when you run the code below. You must completely fill this out in order to receive credit for the assignment!

Direct Link to Google Form

If you have trouble with the embedded form, please make sure you log on with your MSU google account at googleapps.msu.edu and then click on the direct link above.

Assignment-Specific QUESTION: Where you able to get the ODE code working in the above example. If not, where did you get stuck?

Put your answer to the above question here

QUESTION: Summarize what you did in this assignment.

Put your answer to the above question here

QUESTION: What questions do you have, if any, about any of the topics discussed in this assignment after working through the jupyter notebook?

Put your answer to the above question here

QUESTION: How well do you feel this assignment helped you to achieve a better understanding of the above mentioned topic(s)?

Put your answer to the above question here

QUESTION: What was the most challenging part of this assignment for you?

Put your answer to the above question here

QUESTION: What was the least challenging part of this assignment for you?

Put your answer to the above question here

QUESTION: What kind of additional questions or support, if any, do you feel you need to have a better understanding of the content in this assignment?

Put your answer to the above question here

QUESTION: Do you have any further questions or comments about this material, or anything else that's going on in class?

Put your answer to the above question here

QUESTION: Approximately how long did this pre-class assignment take?

Put your answer to the above question here


Congratulations, we're done!

Course Resources:


Written by Dr. Dirk Colbry, Michigan State University Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.