# vector fields and dynamical systems

1. Feedback

1. Feedback

• In 1920s: ecologists began to study the populations of two Arctic species, lynx (a predator) and snowshoe hares (their prey)
• Population oscillates: what causes these oscillations?
• The prey population positively affects the number of predators, while the predator population negatively affects the number of prey = negative feedback on the prey
• The purpose of this book: learn the art of making mathematical models of natural phenomena and learning how to predict behavior from them.

1. Feedback

1. Feedback

Positive feedback

Negative feedback

A positive value of a variable => increase in that variable,

A negative value of a variable => decrease (more negative)

A positive value of a variable => decrease in that variable,

A negative value of a variable => increase

1. Feedback

Examples: what is it?

Methane is a greenhouse gas 25 times more potent than CO2. Large amounts of methane are trapped in Arctic permafrost and at the bottom of the ocean. Rising temperatures cause this methane to be released, contributing to further temperature increases.

Positive

1. Feedback

Examples: what is it?

Negative

Insulin/Glucose: Intake of glucose (say, as a result of a meal) causes the pancreas to secrete more insulin, which then lowers the level of glucose by helping the glucose to be metabolized in the body.

1. Feedback

Examples: what is it?

Negative

A person whose bank account is low might work overtime to bring it back up and then cut back on overtime when there is sufficient money in the account.

1. Feedback

Examples: what is it?

Positive

Animals have young, which increases the population. The larger the population is, the more babies are born, which makes the population even larger. As long as resources
are available, the population will keep growing.

1. Feedback

Examples: what is it?

Positive

Practicing a sport or musical instrument. Practice makes you better at the activity, which makes you enjoy it more, which makes you practice more.

1. Feedback

Examples: what is it?

Negative

A thermostat that controls an air conditioner. When the temperature goes up, the air conditioner comes on, which causes the temperature to go down. The thermostat can also control a heater, in which case a decrease in temperature causes the heater to turn on, which raises the air temperature.

1. Feedback

Counterintuitive behavior

Most real systems consist of multiple feedback loops that interact. E.g predator–prey system

• Negative feedback loop: large pray population --> predators cause the prey population to decrease
• A positive feedback loop: a species causes its own population to increase through births.

=> results in counterintuitive behavior

1. Feedback

Counterintuitive behavior

To understand how your system works, you have to make a model to understand this system.

Example: intervention in the shark tuna model. We want to reduce the number of sharks in an ecosystem. (This might actually
be done in fisheries management.)

• Lowering the number of sharks takes the pressure off the tuna population, which grows to a higher level than before.
• The higher tuna population then gives rise to an even higher shark population.
• => Thus, removing sharks dramatically actually results in a higher peak shark population!

1. Feedback

Counterintuitive behavior

rebound effect: shark removal makes them come back higher

1. Feedback

Other example: testosteron

• Hormone that enhances muscle building:
drug used for performance enhancement

• But testosterone, like all hormones, is under negative feedback:
-sensors in the brain and pituitary gland register amount of
circulating testosterone
-respond with negative feedback: higher levels of
testosterone --> lower output of testosterone-stimulating
factors

• => main symptom = testicular atrophy: caused by shutdown of the native system due to the negative feedback.

2. State and state spaces

2. State and state spaces

• System: state variables. eg #sharks #tuna's

• Deciding what variables to focus on is often one of the hardest parts of building a model

• State variables have a value at each moment in time
#sharks = 20.5  (continuous value)

2. State and state spaces

#sharks

#tuna

t1

t2

Change is a movement through state space

2. State and state spaces

How do we model that change?

Key question!

3. modeling change

3. modeling change

Simple example

X = the amount of water

X' = [the things that change X]

3. modeling change

Simple example

X = the amount of water

X' = the faucet = 10 (l/min)

3. modeling change

Simple example

X = the amount of water

X' = [the things that change X]

3. modeling change

Simple example

X = the amount of water

X' = - outflow = -0.2 X

outflow is proportional to the amount of water in the tub

3. modeling change

Simple example

X = the amount of water

X' = - outflow = -0.2 (1/min) X

The units must always make sense in a change equation!

3. modeling change

Other examples

hot coffee in room

T' = const (T - r)

• T = temperature of the coffee
• r = temperature of the room
• const = proportionality constant: what is the sign?

T' = -k (T - r)

3. modeling change

Other examples

3. modeling change

change in amount of water (per time) = inflow rate - outflow rate

change in population (per year) = births per year + immigrants per year - deaths per year - emigrants per year

3. modeling change

3. modeling change

One variable systems

X' = birth rate - death rate

But how do we represent the birth and death rates?

We are going to have to make some highly simplified assumptions. These assumptions are very strong and have huge consequences for the model.

population model

3. modeling change

X' = birth rate - death rate

But how do we represent the birth and death rates?

1 baby every 2 years per animal

what is the birth rate then?

One variable systems

population model

3. modeling change

X' = birth rate - death rate

But how do we represent the birth and death rates?

Which assumptions did we take here?

One variable systems

population model

birth rate = 0.5 (babies/year) X = b X

3. modeling change

X' = birth rate - death rate

But how do we represent the birth and death rates?

1. there are no sexes; all animals are capable of giving birth,
2. an animal’s ability to give birth is constant over its lifetime from birth to death
3. all animals have the same likelihood of giving birth.

One variable systems

population model

birth rate = 0.5 (babies/year) X = b X

3. modeling change

death rate = - d (deaths/year) X

X' = birth rate - death rate

But how do we represent the birth and death rates?

One variable systems

X' = b X - d X = (b - d) X

population model

problem: this will grow infinitely or go to zero

birth rate = 0.5 (babies/year) X = b X

3. modeling change

One variable systems

population model with crowding

• effect of crowding = competition for scarce resources:  carrying capacity of k animals

• X/k = fraction of the carrying capacity that is already being used by the present population X

• (1 - X/k) = fraction available

• X' = bX(1-X/k)

What happens when X is larger then k?

3. modeling change

Two variable systems

romeo and juliet

• R  = Romeo’s feelings for Juliet
• J = Juliet’s feelings for Romeo
• R, J > 0: love  R, J < 0: hatred
• Changes in Juliet’s love do not depend on her own feelings, but are purely a reflection of Romeo’s love for her. If his love is positive, hers grows, and if he hates her, her love will decrease, possibly even into hate
• => J' = R
• Romeo has issues. He also does not care about his own feelings and only reacts to Juliet, but in his case, the reaction is negative. If Juliet loves him, his love declines, and if she hates him, his love will increase
• => R ′ = −J.

3. modeling change

Two variable systems

springs

Two state variables: X and V:

• X' = V
• V' = F/m = (- kX)/m
• X' = V
• V' = -X

k/m = 1 =>

Romeo & Juliet

3. modeling change

Two variable systems

sharks & tuna

Sharks: S' = ???

• Sharks will die: S' = -d S
• Sharks will eat tuna and increase because of that:

S' = m βST − dS

• chance they meet: S T

• chance shark catches the tuna: β S T

• increase due to eating: m β S T

3. modeling change

Two variable systems

sharks & tuna

Tuna: T' = ???

• Tuna will be born: T' = b T
• Tuna will be eaten by sharks: T' = bT - β S T

S' = m βST − dS

T' = bT - βST

S' = ST − S

T' = T - ST

3. modeling change

Two variable systems

chemistry

Two molecules of A combine to form each molecule of B, so each successful collision removes two molecules of A

A' = -2 kAA

3. modeling change

Two variable systems

chemistry

What makes A go down is A combining with B to make C. So, how often will an A molecule bump into a B molecule?

A' = -kAB

Same reasoning as shark tuna!

3. modeling change

Two variable systems

chemistry

Similar reasoning as shark tuna!

S' = m βST − dS

T' = bT - βST

careful, only works if m = 1

3. modeling change

Two variable systems

chemistry

equilibrium: A' = 0 =>

3. modeling change

Three variable systems

HIV response body

McLean–Phillips model

1. virus

V

R

E

change in amount of virus (per day) = viruses produced per day
− viruses dying per day

100 V produced per day by an actively infected cell

virus lives half a day

write eq!

3. modeling change

Three variable systems

HIV response body

McLean–Phillips model

1. virus

V

R

E

change in amount of virus (per day) = viruses produced per day
− viruses dying per day

3. modeling change

Three variable systems

HIV response body

McLean–Phillips model

2. uninfected cells

V

R

E

change in uninfected cells (per day) = cells produced per day
− cells dying per day
− cells infected per day

0.272 cells produced/day

per capita death rate is 0.00136

when virus meets uninfected cell: chance to get infected of 0.00027 * 100 percent

3. modeling change

Three variable systems

HIV response body

McLean–Phillips model

2. uninfected cells

V

R

E

change in uninfected cells (per day) = cells produced per day
− cells dying per day
− cells infected per day

3. modeling change

Three variable systems

HIV response body

McLean–Phillips model

3. actively infected cells

V

R

E

change in infected cells (per day) = cells infected per day
− infected cells dying per day

per capita death rate is 0.33

when virus meets uninfected cell: chance to get infected of 0.00027 * 100 percent

3. modeling change

Three variable systems

HIV response body

McLean–Phillips model

3. actively infected cells

V

R

E

change in infected cells (per day) = cells infected per day
− infected cells dying per day

3. modeling change

Three variable systems

HIV response body

McLean–Phillips model

V

R

E

3. modeling change

Three variable systems

Epidemiology

Next week will we go in detail on epidemiology models, on understand how the famous corona curve can be simulated! (#flattenthecurve)

3. modeling change

All the models are differential equations.

We will now learn how to understand these model!

4. change vectors

4. change vectors

1. All possible of X = the state space of the model
2. All possible values of X'

X' = 0.2 X

vector field: state space → tangent space

4. change vectors

1. All possible of X = the state space of the model
2. All possible values of X'

X' = 0.2 X

vector field: state space → tangent space

We write them in the same picture, but they are in a different space!

1 dimensional

4. change vectors

X' = r X (1 - X/k)

draw the change vectors!

1 dimensional

4. change vectors

X' = r X (1 - X/k)

1 dimensional

4. change vectors

2 dimensional

X' = V

V' = -X

Exercise 1

# Euler's method

5. trajectories

5. trajectories

S' = ST − S

T' = T - ST

The shark-tuna model

Given an initial condition, what is the exact solution of the model?

• Point moves trough state space = solution curve or trajectory
• Trajectory follows the change vectors
• Every initial condition gives a different trajectory
• We do not see how fast it travels

5. trajectories

population model with crowding: X' = r X (1 - X/k)

5. trajectories

two possible trajectories:

time series:

see exercises!

5. trajectories

see exercises!

circular

stable spiral

5. trajectories

circular: like the spring

spring with friction: what will happen?

5. trajectories

uniqueness of a trajectory

change vectors: exactly one for each point in state space

S' = ST − S

T' = T - ST

what does this say about a trajectory?

they cannot cross! (and also not touch-> theorem of uniqueness)

5. trajectories

Q1: Does the red curve really exist? Is there really a single trajectory through a given point that everywhere follows the change arrows?

Q2: Can we figure out the equation for the red curve from the equation for the vector field?

Yes, almost always

No, almost never

6. Euler integration

6. Euler integration

• Start from initial condition X0

• Follow the change vector out of X0: X0′

• But for how long do you follow the change vector?

infitesimal

=> this means you can never find the exact solution?

6. Euler integration

make Δt very small but not zero

one dimensional example: X' = 0.2 X

= X1

6. Euler integration

two dimensional example

see exercises!

6. Euler integration

Shadowing lemma: as ∆t gets smaller and smaller, the blue jagged line gets closer and closer to a true red curve, possibly from a slightly perturbed initial condition.

6. Euler integration

7. epidemiology

7. epidemiology

Epidemics:

• Black death 1347- 1350: Europe lost 1/3 of population
• Great Plague of London 1664–66: Killed more than 75,000 of total population of 460,000 in London
• Spanish flue 1918-1919: 25 million killed in Europe
• SARS-CoV-1 2002: 774 death, but was only stopped by quarantine of sick people (disease was only transmissible when person had symtoms)
• Covid-19 2020: put the whole world in lockdown

Mathematical models predict rate of spread, peak, and effect of taking different measures

7. epidemiology

Most simple model - the SIR model

• Susceptible class S: those who may catch the disease but currently are not infected
• Infected class I: those who are infected and currently contagious
• Removed class: those who cannot get the disease, because they either have recovered permanently, are naturally immune, or have died

7. epidemiology

Epidemics occur when dI/dt > 0

When does an epidemic occur?

7. epidemiology

• β = infection rate
• γ = removal rate

7. epidemiology: SIR model

• β = infection rate
• γ = removal rate
• Assume I > 0
• If β/γ > N/S then dI/dt > 0
• R0 = β/γ   called basic reproduction number
• N/S is initially about 1
• R0 > 1 give rise to epidemic

7. epidemiology: SIR model

Meaning of β:

β describes the infection rate: an infected subject will infect βS/N people per unit of time. If N is close to S, this means that per unit of time (a day) about β people will be infected

7. epidemiology: SIR model

Meaning of γ:

If the period of contagion lasts 7 days, then each day we expect roughly or approximately 14% of the total number of infectives to move from the infective class I t into the removed class R.

γ  = 1/7 (days)  => 1/γ = total duration illness (days)

7. epidemiology: SIR model

Meaning of R0 = β/γ

• Ratio between new infections per unit of time (a day) and removal of infections per unit of time (a day).
• As 1/γ is the total duration of the illness R0 = total number of infection of a single person in a fully susceptible population

If this ratio is larger then N/S(0), we get an epidemic

7. epidemiology: SIR model

In the SIR model, after falling ill, a subject can heal or die; moreover, if healed, the subject cannot be infected again (he becomes immune).

7. epidemiology: SIR model

Exercise! Implement this model

7. epidemiology: SIER model

One extra step - the SIER model

• Susceptible class S: those who may catch the disease but currently are not infected
• Exposed class E: subjects exposed to the infection (subjects who come into contact with infected individuals, but are not necessarily infected).
THIS ADDS A LATENCY TO THE MODEL
• Infected class I: those who are infected and currently contagious
• Removed class: those who cannot get the disease, because they either have recovered permanently, are naturally immune, or have died

7. epidemiology: SEIR model

One extra step - the SEIR model

α (alpha) is the inverse of the average time of incubation, that is, of the period that elapses between when an individual has been infected and when it becomes contagious in turn.

7. epidemiology: SIER model

The effect of social distancing:

ρ = index of social distancing

• will modify the evolution of susceptible and exposed
• can have a value from 0 (in this case the whole population is in quarantine, complete lock down) to 1 (no social distancing = SEIR model).

7. epidemiology: SIER model

The effect of social distancing:

Simulate the effect of trying to flatten the curve!

#### Week 1& 2: vector fields, euler integration

By Nele Vandersickel

• 43