1.3 States and State Spaces

A state of a system is a list of its attributes at a given time.

In Mathematical terms, a state of a system is a list of values of some functions of time.

Deciding which attributes (variables) to focus on is often one of the hardest parts of building a model.

For example, system = your bank account. $A(t) =$ amount of money in it.

Then $A(\text{Jan})$ (you amount of your bank account at the end of January) is a state of this system.

We think of the functions involved as variables (varying with time) and called them state variables (many of them have units).

The choice of state variables is determined by both the structure of the system and how we plan to use the model.

In a mathematical model, the state of a system is described by a list of numbers.

In other words, state variables are quantitative (e.g. its velocity (m/s, mph), shark population, blood glucose concentration (mg/dL))

System = A cup of coffee

State variables = Temp ($^o$C), Weight (g), Volume (ml), Caffeine concentration (mg/ml)

e.g. a state of this cup of coffee could be

$(63.1 ^o \mathrm{C}, 128\mathrm{g}, 470\mathrm{ml}, 0.6 \mathrm{mg/ml})$

System = A person

State variables = Temp ($^oC$), (systolic blood pressure (mmHg), diastolic blood pressure (mmHg), heart rate (beats/min))

A state of a person could be

$(37 ^\circ \mathrm{C}, 110 \mathrm{mmHg}, 70 \mathrm{mmHg}, 69 \mathrm{beats/min})$

Exercise 1.3.1 Give possible units for measuring the following variables. Feel free to look up information as necessary.

a) Population density of prairie dogs

b) Concentration of epinephrine in the bloodstream

c) Amount of energy in a battery

State variables are functions of time.

For each point $t$ in time, we have a value of $X$ (e.g. # of sharks) and we often write this value as $X(t)$.

A plot of a state variable against time, is called a time series.

For the overwhelming majority of biological models, there is no known formula for the time series.

However, an understand of functions will prove very useful in studying these models.

State Space

When we work with dynamical models, our primary interest is not in learning what state a system happens to be in at a particular time.

Rather, we want to understand the system’s behavior —its changes from state to state---in short, how the system evolves over time and why it exhibits one pattern of behavior rather then another.

The set of all conceivable state values of a system is called it state space.

In other words, the state space of a system is a fixed codomain of the list of states variables.

The assumption of continuity

We assume state variables take real values.

E.g. We don't worry so much of what it means to have $3457.1$ rabbits.

However, this assumption can go wrong if when the state variables only have a few discrete values.

Read p.17 for details.

Basically, we just due with state spaces that are subsets of $\mathbb{R}^n$ (space of all $n$-tuples of real numbers.)

One-Variable Systems

In the one dimensional case, basically a state space is an interval of the real number line.

For example,

Voltage $(-\infty, \infty)$

Population size $[0,\infty)$

Fraction of a wolf population that has black fur $[0,1]$

Exercise 1.3.2 What is the state space for the number of ants in an ant colony?

Exercise 1.3.3 What is the state space for temperature measured in degrees Celsius? (Be careful!)

Doing Math with States (States arithmetic)

We can work with states mathematically:

  • add $X_1 + X_2$
  • multiply a SV with a scalar (scalar multiplication) $kX_1$

Of course, we should perform such operations only when they make physical sense. Multiplying a population size by a negative scalar would give you a negative population. If we are talking about raw population numbers, then this is physical nonsense.

Tuples operations

  • addition $$(S_1, T_1) + (S_2 ,T_2) = (S_1+T_1, S_2+T_2)$$

  • scalar multiplication $$a(S_1,T_1) =(aS_1 ,aT_1)$$

Exercise 1.3.4 Compute the following:

a) $5(10, 2)$

b) $(4, 7) + (3, 9)$

c) $2(3, 2) − 3(5, 4)$

Ans

a) $(50,10)$, b) $(7,16)$ and c) $(-9,-8)$

The Geometry of States

Plot the states as points

A system’s state space is often named by its variables.

For example, the state space whose variables are insulin and glucose concentrations is called “insulin–glucose space” and that of a model of susceptible and infected populations can be referred to as “susceptible–infected space.”

Exercise 1.3.5 Suppose we are modeling a black-bear population consisting of juveniles and adults. Draw the appropriate axes and a point representing the state of the black-bear population if there are

a) 200 juveniles and 100 adults

b) 30 juveniles and 50 adults

c) 0 juveniles and 25 adults

Here is how to do scatter plot (plotting points) using Python.

In [2]:
import matplotlib.pyplot as plt

plt.rcParams['figure.figsize']=(10,6)

j=[200,30,0]
a=[100,50,25]

# Setting the fontsize of the axis label to 20
plt.ylabel('adult', fontsize=20)
plt.xlabel('juvenile', fontsize=20)

plt.scatter(j,a, color='red')
plt.show()
Out[2]:
No description has been provided for this image

Exercise 1.3.6 Pick a two-variable system of any kind and draw its state space and a point representing a system state. Describe the state this point represents.

We think of a pair of real numbers $(X,Y)$ as a (2-dimensional) vector. We represent the vector $(X,Y)$ by an arrow from the origin to the point $(X,Y)$.

The 2-dimensional vectors together with the operations addition and scalar multiplication form a structure called the 2-dimensional real vector space and is denoted by $\mathbb{R}^2$.

Exercise 1.3.7 Draw two vectors and the same vectors multiplied by $−1$.

Exercise 1.3.8 Draw two vectors and show their sum.

Here are references for defining vectors and ploting vectors as arrows in Python

In [4]:
# Answer to 1.3.7

# create a vector
# first import from the package numpy the method "array"
from numpy import array

# represent a vector as an array
v = array([2, 5])

# w = -v
w = -v
print(v,w)
[2 5] [-2 -5]
In [5]:
# Now we can plot the vectors
import matplotlib.pyplot as plt

# Plot the vectors as arrows
plt.quiver(0, 0, v[0], v[1], angles="xy", scale_units="xy", scale = 1, color="Red")
plt.quiver(0, 0, w[0], w[1], angles="xy", scale_units="xy", scale = 1, color="Blue")

# Set the limits for the plot
plt.xlim([-5, 5])
plt.ylim([-5, 5])

# Set the labels for the plot
plt.xlabel('X')
plt.ylabel('Y')

# Show the grid lines
plt.grid()

# Show the plot
plt.show()
Out[5]:
No description has been provided for this image
In [6]:
# Answer for 1.3.8
# First define two vectors in R^2

v1 = array([1,3]); v2 = array([2,-2])

# And let w be their sum
w = v1 + v2

# Plot the vectors and their sum as arrows
plt.quiver(0, 0, v1[0], v1[1], angles="xy", scale_units="xy", scale = 1, color="Red")
plt.quiver(0, 0, v2[0], v2[1], angles="xy", scale_units="xy", scale = 1, color="Blue")
plt.quiver(0, 0, w[0], w[1], angles="xy", scale_units="xy", scale = 1, color="Green")

# Set the limits for the plot
plt.xlim([-5, 5])
plt.ylim([-5, 5])

# Set the labels for the plot
plt.xlabel('X')
plt.ylabel('Y')

# Show the grid lines
plt.grid()

# Show the plot
plt.show()
Out[6]:
No description has been provided for this image

State Spaces with More than Two Dimensions

Generalizing all these, we can consider $n$-dimensional vectors

$\mathbf{a} = (a_1,\ldots, a_n)$, $\mathbf{b} = (b_1, \ldots, b_n)$, ....

Again the two operations on vectors, addition and scalar multiplication, are defined componentwise:

$$\mathbf{a}+ \mathbf{b} = (a_1,\ldots, a_n)+ (b_1, \ldots, b_n) = (a_1+b_1, \ldots, a_n+b_n)$$

and for $c \in \mathbb{R}$,

$$ c\mathbf{a} = c(a_1,\ldots, a_n) = (ca_1,\ldots, ca_n)$$

Exercise 1.3.9 Carry out the following operations, or say why they’re impossible.

a) $(1, 2, 3) + (−2, 0, 5)$

b) $−3(4, 6, −9)$

c) $(2, 4) + (1, 3, 5)$

d) $5((0, 1) + (7, 3))$