Biology is the study of life

Life is a complex phenomenon

To understand life, biologists invented *Systems Theory*

April 21, 2020

Biology is the study of life

Life is a complex phenomenon

To understand life, biologists invented *Systems Theory*

*Systems Theory* was invented in 1948 by the biologist Ludwig von Bertalanffy

Today it is used by engineers, psychologists, managers, and other scientists

It is going to be one of the important ways of thinking in this century

A *system* is a group of *parts* that are *interconnected* and affect each other

- The
*parts*are separated and well defined - Instead of
*parts*, we can say*items*or*components* - They have
*interactions*, for example a*process*that transforms some*items*into others

Today we will study a system with two *items*

**Cells****Food**

and one *process*

**Eating**, which also was*cell duplication*

The arrows going into a box show which items are required for the process

- The items that point towards a process are the
**inputs**that will be consumed by the process- When a
*item*is consumed by a*process*, its amount gets smaller

- When a
- The arrows going out of a box show which are the
**products**of the process- The amount of these
*items*will increase with the*process*.

- The amount of these

At any given moment, there is some **amount** of each item in the system

- for example, the
*number of cells*

Also, we can know how much did the amount **changed** between the previous moment and this moment

- for example, the
*growth*of cells

Each *item* (circle) has two values, that change with time

We will represent these values with vectors

- The amount of
*item*will be called`item`

- The change of
*item*will be called`d_item`

- We read it
*“delta-item”*

- We read it

*Dynamical system* means that the system changes with **time**

We will represent *time* by a positive integer number

Time `i`

represents *“now”*. The units can be seconds, hours, days, years, or whatever is best to understand the system

If we use “days”, then `i-1`

means *“yesterday”*. It can also be *“last year”* or *“one second ago”*

- The particular condition that someone or something is in at a specific time
*water in a liquid state.*

**The amounts of all items (circles) in a system.**`cells[i]`

`food[i]`

In any fixed time, the state is all the values of items’ quantities

- one value for each item
- Examples:
`cells[i]`

,`food[i]`

- Concentration of H, O, Water
- Number of foxes and rabbits
- Number of primers and DNA molecules

The “boxes” of the system represent *processes*

They do not change with time

The have one constant value called *rate*

For each *process* we have a value `process_rate`

The new state depends only on the past states, **nothing else**

If we know the initial state and rate constants, we can calculate **everything**

For each box in the graph we get only one *term*

We **multiply** the *rate* constant and each of the *amount* variables of the circles connected by incoming arrows

We use the index `i-1`

. Processes depend on the previous values

If there are several incoming arrows from the same circle, then the variable is multiplied several times

The outgoing arrows are not important in this part

We will write the formulas for the **cell–food** system

- First write the terms for each box (process)
- Then write the formulas for each circle (item)

There are two arrows coming into the *eating* box

The formula for this box is

eating_rate * cells[i-1] * food[i-1]

We use the index `i-1`

because we do not know yet the value of `cells[i]`

or `food[i]`

We will calculate them later

At the begin of *“today”* we only know *“yesterday”*

To get the formula for each circle

**sum**all the*terms*of boxes connected with incoming arrows,**minus**all the*terms*of boxes connected with outgoing arrows

This value is assigned to the *delta* variable of the circle.

In our example the formula for *delta_food* is

d_food[i] <- -eating_rate * cells[i-1] * food[i-1]

since the *food* circle has only one outgoing arrow

The *cell* circle has two incoming arrows

from *eat* and one outgoing arrow to *eat*.

Therefore

d_cells[i] <- eating_rate * cells[i-1] * food[i-1] + eating_rate * cells[i-1] * food[i-1] - eating_rate * cells[i-1] * food[i-1]

which, after simplification, is just

d_cells[i] <- eating_rate * cells[i-1] * food[i-1]

resulting on a final result of one positive incoming arrow

In the last slide we had several arrows between the *cells* circle and the *eating* box

It is easy to see that we only care about the *resulting* number and direction of arrows

Two input - One output = One input

for all the

d_food[i] <- -eating_rate * cells[i-1] * food[i-1] d_cells[i] <- eating_rate * cells[i-1] * food[i-1]

Finally, the *amount* variables have to be updated

Each *amount* variable is the cumulative sum of the *delta* variables

food[i] <- food[i-1] + d_food[i] cells[i] <- cells[i-1] + d_cells[i]

The last missing piece are the initial values of the circles’ variables.

The value of `cells[i]`

depends on the value of `cells[i-1]`

, and we can only calculate that for `i >= 2`

We will use the variables `cells_ini`

and `food_ini`

to define the values used in `cells[1]`

and `food[1]`

For the *delta* variables, we can assume that they are initially zero.

N <- 168 cells <- d_cells <- rep(NA, N) food <- d_food <- rep(NA, N) cells[1] <- 1 food[1] <- 20 d_cells[1] <- d_food[1] <- 0 for(i in 2:N) { d_cells[i] <- cells[i-1]*food[i-1]*eating_rate d_food[i] <- -cells[i-1]*food[i-1]*eating_rate cells[i] <- cells[i-1] + d_cells[i] food[i] <- food[i-1] + d_food[i] }

cell_culture <- function(N, eating_rate, cells_ini, food_ini) { cells <- d_cells <- rep(NA, N) food <- d_food <- rep(NA, N) cells[1] <- cells_ini food[1] <- food_ini d_cells[1] <- d_food[1] <- 0 for(i in 2:N) { d_cells[i] <- cells[i-1]*food[i-1]*eating_rate d_food[i] <- -cells[i-1]*food[i-1]*eating_rate cells[i] <- cells[i-1] + d_cells[i] food[i] <- food[i-1] + d_food[i] } return(data.frame(cells, food, d_cells, d_food)) }

system_name <- function(N, rates, initial_cond) { state <- d_state <- rep(NA, N) state[1] <- initial_cond d_state[1] <- 0 for(i in 2:N) { d_state[i] <- some formula state[i] <- state[i-1] + d_state[i] } return(data.frame(state, d_state)) }

In R we can write several assignments in one line

Instead of

A <- rep(NA, N) B <- rep(NA, N) C <- rep(NA, N)

we can write

A <- B <- C <- rep(NA, N)

This online material will show you the big picture

- Systems theory in Wikipedia
- System dynamics
- Some Basic Concepts in System Dynamics Jay W. Forrester, MIT Sloan School
- The Beginning of System Dynamics Jay W. Forrester, MIT Sloan School
- The Limits to Growth

We will only do the simple cases