introduction to ode modeling shlomo ta’asan carnegie mellon university

31
Introduction to ODE Modeling Shlomo Ta’asan Carnegie Mellon University

Upload: kory-baldwin

Post on 03-Jan-2016

234 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Introduction to ODE Modeling Shlomo Ta’asan Carnegie Mellon University

Introduction to ODE Modeling

Shlomo Ta’asanCarnegie Mellon University

Page 2: Introduction to ODE Modeling Shlomo Ta’asan Carnegie Mellon University

Plan

We will learn in this tutorial: translating biological knowledge to differential equations models

In the afternoon Lab we use matlab to simulate models generate graphs, make predictions, ...

In particular we will modelReactions, Trafficking, Simple infections

Participants will also have an opportunity to ‘play’ with more complex models

Lotka-Volterra – periodic solutionsLorenz model – chaos

Page 3: Introduction to ODE Modeling Shlomo Ta’asan Carnegie Mellon University

Modeling

Biology Driven ModelsBiology is understood and is translated into equations, reactions, graphs,

Data Driven Modeling: Use experimental data only to construct models

Main ingredients : Objects: molecules (cytokines/chemokines/...),

cells (Macrophages, Neutrophils, ...),organs( lymph node, spleen, .., lung,.. )

Actions: trafficking/migration, interaction (activation/inhibition), proliferation

Differential equations are about rate of change of quantities

Page 4: Introduction to ODE Modeling Shlomo Ta’asan Carnegie Mellon University

Ordinary Differential Equations (ODE)

a – some quantityexamples: cell count, receptor expression level, cell damage, ...

We write ODE as da/dt = f where f may be a complex formula

We interpret this ODE as da = f * dt

- we read it as: the change in a during a short time interval dt is equal to f times dt

Page 5: Introduction to ODE Modeling Shlomo Ta’asan Carnegie Mellon University

The evolution of a through time is done in small steps of size dtAccording to the equation

a(t+dt) = a(t) + f * dt

(this is what we do in Matlab in the afternoon)

0

0.5

1

1.5

2

2.5

3

3.5

4

4.5

0 0.5 1 1.5 2 2.5

dt

f * dt

Page 6: Introduction to ODE Modeling Shlomo Ta’asan Carnegie Mellon University

Basic Example 1

1. da/dt = 0 This means da = 0 * dt = 0 change in a is 0, a does not change

0

0.5

1

1.5

2

2.5

3

3.5

0 0.5 1 1.5 2 2.5

Page 7: Introduction to ODE Modeling Shlomo Ta’asan Carnegie Mellon University

Basic Example 2

2. da/dt = 2- This means da = 2 * dt a changes by 2 * dt

0

0.5

1

1.5

2

2.5

3

3.5

4

4.5

0 0.5 1 1.5 2 2.5

Page 8: Introduction to ODE Modeling Shlomo Ta’asan Carnegie Mellon University

Basic Example 3

3. da/dt = - a da = - a * dt a changes by – a * dt- This means that a decreases, and the reduction is large when a is large and getting small when a is getting smaller.

0

0.2

0.4

0.6

0.8

1

1.2

0 1 2 3 4 5

Page 9: Introduction to ODE Modeling Shlomo Ta’asan Carnegie Mellon University

What do we want to model?

- interactions in the immune systemcell-cell, virus/bacterium – cell, molecule (cytokine/chemokine)-cell, etc

- trafficking - Natural killer trafficking between organs in the

body- Dendritic cell migration from tissue to lymph-node

Spread of disease in a population (in a given location)HIV, Influenza A

?? Pandemic – worldwide spread of an infectionfocus on the spatial aspect – spread between

countries, continents

Page 10: Introduction to ODE Modeling Shlomo Ta’asan Carnegie Mellon University

Preparation for Modeling - Some Syntax

Syntax: A 0Meaning: “A dies”, “Neutrophil goes apoptosis”, “bacteria die” etc.

Syntax A BMeaning: “ A changes into B”

for example: A – macrophage, B – activated macrophage

Syntax: A + B CMeaning: “A and B interact to give C” or If A meets B then C is produced.

Page 11: Introduction to ODE Modeling Shlomo Ta’asan Carnegie Mellon University

B 0 B degrades

A + B A B degrades in the presence of A

S + A SAS + B SBSA + B SABSB + A SAB

S SA SB SAB

Page 12: Introduction to ODE Modeling Shlomo Ta’asan Carnegie Mellon University

Modeling Reactions - The Law of Mass Action

“The rate of change of products is proportional to the product of reactants concentration”

A 0The only reactant (left side) is a :

rate of change is proportional to a,

ODE da/dt = -k*a (minus sign since we loose a)

A B : Similar to the previous case but here one B is created per each A that disappear

ODE da/dt = -k*a as before but we also have db/dt = k*a; here the sign is +

Page 13: Introduction to ODE Modeling Shlomo Ta’asan Carnegie Mellon University

Modeling Reactions – cont.

A + B C;

Here the reactants (left side) is A and B, the product (right side) is C.

dc/dt = k *a*b; C is created at a rate proportional to the product of the concentration of A and B

da/dt = - k*a*b; The rate of change of A is tha same as the rate of change of C – per each C that is created one A is lost

db/dt = - k*a*b, similar to A.

Page 14: Introduction to ODE Modeling Shlomo Ta’asan Carnegie Mellon University

Modeling Reactions – cont.

• A + B A; (B degrades in the presence of A)

Here the reactants (left side) is A and B. The right hand side is A. This means that A does not change!

da/dt = 0;

The change in B according to the law of mass action is proportional to the product of A and B

db/dt = - k*a*b;

• In contrast

B 0 (B degrades) db/dt = -k * b

Page 15: Introduction to ODE Modeling Shlomo Ta’asan Carnegie Mellon University

Modeling Trafficking

An example: Macrophages are trafficking between lung to Lymph node and back

Want to know the number of macrophages in lung ad Lymph node as time progress.

L: Number of Macrophages in the LungLN: Number of Macrophages in the Lymph Node

Assumption: When a macrophage leaves the lung it ends at the lymph node and vice versa. The rate of trafficking is proportional to the number of cell.

This sounds a lot like our reactions before.

Page 16: Introduction to ODE Modeling Shlomo Ta’asan Carnegie Mellon University

Trafficking – cont.

We use our syntax:

L LN and LN L written also as L LN

The rate at which cells arrive to the lymph node from the lung is proportional to the number of cells in the lung.

Similarly, rate at which cells arrive to the lung from the lymph node is proportional to the number of cells in the lymph node.

The ODE:

dL/dt = -k1*L + k2 * LN loss + gain

dLN/dt = – k2*LN + k1*L loss + gain

Page 17: Introduction to ODE Modeling Shlomo Ta’asan Carnegie Mellon University

Modeling Infection-The SIR model

Population has three groups: Susceptible (S), Infected (I) and Recovered (R)

The dynamics is expressed in the reactions

S + I -> I + I (rate: r)I -> R (rate: a)

A difficulty: I is changed by multiple reactions. How to

construct the equations (ODE)?

- each reaction is independent of the other- they appear simultaneously- the rate of change of a product is a sum of change coming from all reactions

Page 18: Introduction to ODE Modeling Shlomo Ta’asan Carnegie Mellon University

Biological Description

Translation to Reactions

Translation to ODE

Susceptible meets an infected and become infected

S + I -> I + I dS/dt = - r*S*IdI/dt = r*S*I

Infected becomes recovered

I -> R dI/dt = - a*IdR/dt = a*I

dS/dt = - r*S*IdI/dt = r*S*I - a*IdR/dt = a*I

Complete ODE Model =

SUM of contributions

from all reactions

SIR Model

Page 19: Introduction to ODE Modeling Shlomo Ta’asan Carnegie Mellon University

SIR model

The differential equations

dS/dt = - r*S*I dI/dt = r*S*I – a*IdR/dt = a*I

This model is more interesting. We change the parameters a, r We can also change the initial values for S,R,I and see what happens.

When to expect epidemic? A relation between parameters

Such questions can be answered using some mathematical analysis. In this lectures we do it by simulation.

-- we will do it in the lab

Page 20: Introduction to ODE Modeling Shlomo Ta’asan Carnegie Mellon University

An HIV model

The HIV virus targets specific cells, the CD4+ T cells. These cells may get infected and serve as a virus producing

factory.

In HIV infection the main problem is the decline in the number of CD4+ T cells that are essential for protecting the body form different pathogens. It is important to understand the dynamics of the CD4 cell count as a function of time.

In this simplified model (Perelson) we consider three populations

T - Target cells (CD4 T cells) I - Infected cellsV - Virus

Page 21: Introduction to ODE Modeling Shlomo Ta’asan Carnegie Mellon University

HIV model cont.

Model assumptions:

-> T ; (lambda) % target cells productionT -> 0 ; (d) % target cells natural deathT + V -> I + V ; (k) % target cell becomes infected by virus I -> 0; (delta) % infected cells deathI -> I + V; (p) % virus replication in infected cellsV -> 0; (c) % virus clearance

We construct the equations similar to the SIR model.

Each reaction contribute to changes in several of the variables. We add all the changes together for each variable separately

Page 22: Introduction to ODE Modeling Shlomo Ta’asan Carnegie Mellon University

Biological Description

Translation to Reactions

Translation to ODE

target cells production

-> T ; (lambda) dT/dt = lambda

target cells natural death

T -> 0 ; (d) dT/dt = – d * T

target cell becomes infected by virus

T + V -> I + V; (k) dT/dt = – k * V * T dI/dt = k * V * T

infected cells death

I -> 0; (delta) dI/dt = – delta * I

virus replication in infected cells

I -> I + V; (p) dV/dt = p* I

virus clearance V -> 0; (c) dV/dt = – c * V

dT/dt = lambda – d * T – k * V * T dI/dt = k * V * T – delta * I dV/dt = p* I – c * V

Complete ODE Model is

SUM of contributions

from all reactions

HIV Model

Page 23: Introduction to ODE Modeling Shlomo Ta’asan Carnegie Mellon University

HIV model cont.

The ODE:

dT/dt = lambda – d * T – k * V * T dI/dt = k * V * T – delta * I dV/dt = p* I – c * V

This model has 6 parameters that may affect the behavior.

We will study this in the lab

Page 24: Introduction to ODE Modeling Shlomo Ta’asan Carnegie Mellon University

Reaction Translation to ODE

-> A ; (k1) dA/dt = k1

B -> 0 ; (k2) dB/dt = - k2 * B

A -> B ; (k3) dA/dt = - k3 * A dB/dt = k3 * A

A + B -> C ; (k4) dA/dt = - k4 * A * B dB/dt = - k4 * A * BdC/dt = k4 * A * B

A + B -> A + D; (k5)

dB/dt = - k5* A*BdD/dt = k5* A*B

A + B -> C + D + E; (k6)

dA/dt = - k6 * A * B dB/dt = - k6 * A * B dC/dt = k6 * A * B dD/dt = k6 * A * B dE/dt = k6 * A * B

Complete ODE Model is

SUM of contributions

from all reactions

Quick Manual: From Reactions To ODE

Page 25: Introduction to ODE Modeling Shlomo Ta’asan Carnegie Mellon University

Lotka-Volterra Equation

A + X X + X

X + Y Y + Y

Y B

da/dt = - k1*a*x

dx/dt = k * a * x

dx/dt = - k2 * x * y

dy/dt = k2 * x * y

dy/dt = - k3*y

db/dt = k3 * y

dx/dt = k1*a*x – k2*x*y da/dt = -k1*x*a

dy/dt = k2*x*y – k3*y db/dt = k3*y

Page 26: Introduction to ODE Modeling Shlomo Ta’asan Carnegie Mellon University

Periodic Solutions

0 5 10 15 20 25 30 35 40 45 500

20

40

60

80

100

120Predator - red, prey - blue

Page 27: Introduction to ODE Modeling Shlomo Ta’asan Carnegie Mellon University

Phase Diagramunderstanding complex solutions

0 20 40 60 80 100 1200

10

20

30

40

50

60

70

80

Pre

dato

r

Prey

Page 28: Introduction to ODE Modeling Shlomo Ta’asan Carnegie Mellon University

Chaotic Solutions

dX/dt = -c(X - Y) dY/dt = aX - Y - XZ dZ/dt = b(XY - Z)

a = 28;b = 2.667;c = 10;

0 5 10 15 20 25 30-20

-10

0

10

20

30

40

50

Page 29: Introduction to ODE Modeling Shlomo Ta’asan Carnegie Mellon University

Lorenz Mode – Phase Diagram

-15 -10 -5 0 5 10 155

10

15

20

25

30

35

40

45Lorenz model X vs Z

Page 30: Introduction to ODE Modeling Shlomo Ta’asan Carnegie Mellon University

Now You are Ready to Do Your Own ODE Models

•The Question

•The Variables

•The Interaction/Trafficking/…

•Translate to ODE

•Simulate

•How does ….??

Page 31: Introduction to ODE Modeling Shlomo Ta’asan Carnegie Mellon University

Enjoy!!