COMPUTER MODELS IN BIOLOGY Bernie Roitberg and Greg Baker

Preview:

Citation preview

COMPUTER MODELS IN BIOLOGY

Bernie Roitberg and Greg Baker

WHERE NUMERICAL SOLUTIONS ARE USEFUL

• Problems without direct solutions

WHERE NUMERICAL SOLUTIONS ARE USEFUL

• Problems without direct solutions

• Complex differential equations

WHERE NUMERICAL SOLUTIONS ARE USEFUL

• Problems without direct solutions

• Complex differential equations

• Complex fitness landscapes

WHERE NUMERICAL SOLUTIONS ARE USEFUL

• Problems without direct solutions

• Complex differential equations

• Complex fitness landscapes

• Individual-based problems

WHERE NUMERICAL SOLUTIONS ARE USEFUL

• Problems without direct solutions

• Complex differential equations

• Complex fitness landscapes

• Individual-based problems

• Stochastic problems

WHERE NUMERICAL SOLUTIONS ARE USEFUL

• Problems without direct solutions

THE EULER EXACT r EQUATION

1= e- rx

x=0

3

! lxmx

HOW TO SOLVE THE EULER

• Start with lnR0/G ≈ r

HOW TO SOLVE THE EULER

• Start with lnR0/G ≈ r • Insert ESTIMATE into the Euler

equation. This will yield an underestimate or overestimate

HOW TO SOLVE THE EULER

• Start with lnR0/G ≈ r • Inserted ESTIMATE into the Euler

equation. This will yield an underestimate or overestimate

• Try successive values that approximate lnR0/G until exact value is discovered

SOME GUESSES

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

1 2

Guess r

Value

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1 2

Guess r

Value0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

1 2

Guess r

Value

WHERE NUMERICAL SOLUTIONS ARE USEFUL

• Problems without direct solutions

• Complex differential equations

THE CONCEPT

• For small changes in x (e.g. time) the difference quotient y/x approximates the derivative dy/dx i.e. dy/dx = x 0 y/x

• Thus, if dy/dx = f(y) then y/x≈ f(y) for small

changes in x • Therefore y ≈ f(y) x

THE GENERAL RULE

• For all numerical integration techniques:

y(x + x) = yx + y

EULER SOLVES THE EXPONENTIAL

dn/dt = rNN/t ≈ rN

N ≈ rN t

N(t+t) = Nt + NRepeat until total time is reached.

NUMERICAL EXAMPLE

• N 0+t = N0 + (N0 r T) t = 0.1• N.1 = 100 + (100 * 1.099 * 0.1) = 110.99• N.2 = 110.99 + (110.99 * 1.099 * 0.1) =123.19• N.3 = 123.19 + (123.19 * 1.099 * 0.1) =136.73.• …...• N1.0 = 283.69• Analytical solution = 300.11

COMPARE EULER AND ANALYTICAL SOLUTION

0

50

100

150

200

250

300

350

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

T

N

0

50

100

150

200

250

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

T

N

0

100

200

300

400

500

600

700

800

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

T

N

INSIGHTS

• The bigger the time step the greater is the error

• Errors are cumulative

• Reducing time step size to reduce error can be very expensive

RUNGE-KUTTA

t

N

RUNGE-KUTTA

• ∆yt = f(yt) ∆ t

• yt+ ∆ t = yt + ∆ yt

• ∆ y t+ ∆ t = f(yt+ ∆ t )

• y t+ ∆ t = yt + ((∆yt + ∆ y t+ ∆ t )/2)

COMPARE EULER AND RUNGE-KUTTA

0

1000

2000

3000

4000

5000

6000

7000

8000

9000

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

t

N

WHERE NUMERICAL SOLUTIONS ARE USEFUL

• Problems without direct solutions

• Complex differential equations

• Complex fitness landscapes

COMPLEX FITNESS LANDSCAPES

• Employing backwards induction to solve the optimal when state dependent

• Numerical solutions for even more complex surfaces– Random search

– Constrained random search (GA’s)

TABLE OF SOLUTIONS

Oxygen

Energy

0.1 0.2 0.3 0.4 0.4

0.1 A A A R R

0.2 A R R R D

0.3 R R D D D

0.4 R R D D D

0.5 D D D D D

WHERE NUMERICAL SOLUTIONS ARE USEFUL

• Problems without direct solutions

• Complex differential equations

• Complex fitness landscapes

• Individual-based problems

INDIVIDUAL BASED PROBLEMS

• Simulate a population of individuals that “know” the theory but may differ according to state

WHERE NUMERICAL SOLUTIONS ARE USEFUL

• Problems without direct solutions

• Complex differential equations

• Complex fitness landscapes

• Individual-based problems

• Stochastic problems

STOCHASTIC PROBLEMS

• Two issues:

– Generating a probability distribution

– Drawing from a distribution

FINAL PROBLEM

• What do you do with all those data?