solving differential equations in developmental models of multicellular structures expressed using...

64
Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz University of Calgary

Upload: theodore-wilkerson

Post on 04-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Solving Differential Equations in Developmental Models of Multicellular Structures

Expressed Using L-systems

Pavol Federl and Przemyslaw PrusinkiewiczUniversity of Calgary

Page 2: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Anabaena

heterocyst cellsheterocyst cells vegetative cellsvegetative cells

Page 3: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Anabaena

Page 4: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Anabaena – continuous model

)(

)(

)2(

max

max

ssrdt

ds

ccrdt

dc

rsdt

ds

ccccDdt

dc

s

c

rl

Vegetative cells:

Heterocysts:

Page 5: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

L+C1 = combination of L-systems and C++

1. Karwowski and Prusinkiewicz 2002

Review of L-systems and L+C

Page 6: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Example: cell growth and division

module A(int);axiom: A(2);production:A(s):{

if (s<4)produce A(s+1);

elseproduce A(s/2)A(s/2);

}

A(2)

A(3)

A(4)

A(2)A(2)

A(3)A(3)

Review of L-systems and L+C

Page 7: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

B(0)AAAAAAA

Standard information transfer

B(n)< A : produce B(n+1);

Page 8: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

B(0)AAAAAAA

B(0)B(1)AAAAAA

Standard information transfer

B(n)< A : produce B(n+1);

Page 9: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

B(0)AAAAAAA

B(0)B(1)AAAAAA

B(0)B(1)B(2)AAAAA

Standard information transfer

B(n)< A : produce B(n+1);

Page 10: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

B(0)AAAAAAA

B(0)B(1)AAAAAA

B(0)B(1)B(2)AAAAA

B(0)B(1)B(2)B(3)AAAA

Standard information transfer

B(n)< A : produce B(n+1);

Page 11: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

B(0)AAAAAAA

B(0)B(1)AAAAAA

B(0)B(1)B(2)AAAAA

B(0)B(1)B(2)B(3)AAAA

B(0)B(1)B(2)B(3)B(4)B(5)B(6)B(7)

Time complexity: O(n2)

Standard information transfer

B(n)< A : produce B(n+1);

Page 12: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Fast information transfer in L+C

B(n)<< A : produce B(n+1);

new left context

Page 13: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

B(0) A A A A A A A

B(n)<< A : produce B(n+1);

Fast information transfer in L+C

Page 14: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

B(0) A A A A A A A

B(0)

B(n)<< A : produce B(n+1);

Fast information transfer in L+C

Page 15: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

B(0) A A A A A A A

B(0)

B(n)<< A : produce B(n+1);

Fast information transfer in L+C

Page 16: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

B(0) A A A A A A A

B(0)

B(n)<< A : produce B(n+1);

Fast information transfer in L+C

Page 17: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

B(0) A A A A A A A

B(0) B(1)

B(n)<< A : produce B(n+1);

Fast information transfer in L+C

Page 18: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

B(0) A A A A A A A

B(0) B(1)

B(n)<< A : produce B(n+1);

Fast information transfer in L+C

Page 19: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

B(0) A A A A A A A

B(0) B(1) B(2)

B(n)<< A : produce B(n+1);

Fast information transfer in L+C

Page 20: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

B(0) A A A A A A A

B(0) B(1) B(2) B(3)

B(n)<< A : produce B(n+1);

Fast information transfer in L+C

Page 21: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

B(0) A A A A A A A

B(0) B(1) B(2) B(3) B(4)

B(n)<< A : produce B(n+1);

Fast information transfer in L+C

Page 22: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

B(0) A A A A A A A

B(0) B(1) B(2) B(3) B(4) B(5)

B(n)<< A : produce B(n+1);

Fast information transfer in L+C

Page 23: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

B(0) A A A A A A A

B(0) B(1) B(2) B(3) B(4) B(5) B(6)

B(n)<< A : produce B(n+1);

Fast information transfer in L+C

Page 24: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

B(0) A A A A A A A

B(0) B(1) B(2) B(3) B(4) B(5) B(6) B(7)

B(n)<< A : produce B(n+1);

Fast information transfer in L+C

Page 25: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

B(0) A A A A A A A

B(0) B(1) B(2) B(3) B(4) B(5) B(6) B(7)

Time complexity: O(n)

B(n)<< A : produce B(n+1);

Fast information transfer in L+C

Page 26: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

struct CD { double s, con; bool h; }module C (struct CD);Start: {

CD c1; c1.s=smax; c1.con=cmax; c1.h=true;CD c2; c2.s=smax; c2.con=cmax; c2.h=false;

}Axiom: C(c1) C(c2) C(c1);

Anabaena in L+C

• size• concentration• het./veg.

Page 27: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

C(p): {if (p.h) produce C(p);else if (p.s >= smax && p.con > cmin) {

p.s /= 2;produce C(p) C(p); }

else if (p.con < cmin) {p.h=true;produce C(p);

}

Anabaena in L+C

Division & differentiation

Page 28: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Anabaena – numerical integration

Discrete time intervals Δt

Implicit discretization scheme

Notation: Ci denotes old value (at time t) Ci+1 denotes new value (at time t + Δt)

Page 29: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Implicit scheme

)(

)(

)2(

1max

1

1max

1

11

11111

is

ii

ic

ii

iii

iir

iil

ii

Ssrt

SS

Ccrt

CC

rSt

SS

CCCCDt

CC

Page 30: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Implicit scheme

11111

)2(

ii

rii

l

ii

CCCCDt

CC

System of linear equations matrix form: AX=Y

Tri-diagonal coefficient matrix Efficient solution

modified Gaussian Elimination

Page 31: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Tri-diagonal system of LEs

A Y

Page 32: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

A Y

Gaussian elimination

Page 33: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Gaussian elimination

A Y

Page 34: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Gaussian elimination

A Y

Page 35: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Gaussian elimination

A Y

Page 36: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Gaussian elimination

A Y

Page 37: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Gaussian elimination

A Y

Page 38: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Gaussian elimination

A Y

Page 39: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Gaussian elimination

A Y

Page 40: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Gaussian elimination

A Y

Page 41: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Gaussian elimination

A Y

Page 42: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Gaussian elimination

A Y

Page 43: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Gaussian elimination

A Y

Page 44: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Gaussian elimination

A Y

Page 45: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Gaussian elimination

A Y

Page 46: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Gaussian elimination

A Y

Page 47: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Gaussian elimination

A Y

Page 48: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

L-system implementation

struct CD { double a,b,c,y; }module C (struct CD);

b a 0 0 0 y

a b c 0 0 y

0 a b c 0 y

0 0 a b c y

0 0 0 a b

……

y

……

Page 49: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Phase I Phase II

…… …… ……

L-system implementation

Page 50: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Gaussian elimination in L+C

int phase;Start: {phase=1;}StartEach: {

if (phase == 1) {Forward();UseGroup(1);phase=2;}else {Backward();UseGroup(2);}

}group 1: C(pl) << C(p):{

p.y=p.y-pl.y*p.a/pl.b;p.b=p.b-pl.c*p.a/pl.b;produce C(p);

}group 2: C(p) >> C(pr):{

p.y=p.y-pr.y*p.c/pr.b;produce C(p);

}

Page 51: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

struct CD { double s, con, a, b, c, y; bool h; }module C (struct CD);

Anabaena in L+C

Page 52: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Back to Anabaena

Complete implementation: 5 phases1: setup system of LEs

2: eliminate below diagonal

3: eliminate above diagonal

4: extract result, update s and c

5: divide, differentiate

Page 53: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Animation

Page 54: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Summary

method for automatically modifying and solving systems of ODEs

implicit schemes sample application: anabaena

division, differentiation, information transfer

can be used for 5 and 7-diagonal systems of LEs

Page 55: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

END

Page 56: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Introduction

Information transfer (diffusion)

Dynamically evolving systems of ODEs

L-systems1

External vs. internal solver

Anabaena

1. Lindenmayer 1968

Page 57: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Anabaena – continuous model

axiom: Fh(smax,cmax) Fv(smax,cmax) Fh(smax,cmax)F(sl,cl) < Fv(s,c) > F(sr,cr):

if s < smax & c > cmin

solve dc/dt = D.(cl+cr-2c)-µ.cds/dt = r . s

if s = smax & c > cmin

produce Fv(k . smax,c)Fv((1-k) . smax,c)if c = cmin

produce Fh(s,c)Fh(s,c):

solve ds/dt = rs . (smax-s)

dc/dt = rc . (cmax-c)

Page 58: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Explicit scheme

)(

)(

)2(

max

1

max

1

1

1

is

ii

ic

ii

iii

iir

iil

ii

Ssrt

SS

Ccrt

CC

rSt

SS

CCCCDt

CC

Page 59: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

C C C C C C Ct

C C C C C C Ctt

iir

iil

ii

CCCCDt

CC

)2(1

Explicit scheme

Page 60: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Anabaena – continuous model

Page 61: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Anabaena

Heterocyst spacing relatively constantHeterocyst cells

produce compoundVegetative cells

dividedifferentiateconsume compounddiffuse compound

Page 62: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

C C C C C C Ct

C C C C C C Ctt

Implicit scheme

11111

)2(

ii

rii

l

ii

CCCCDt

CC

Page 63: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

New left context and new right context

Direction of string processing is user controlled:

bool fwd;Start: { fwd = true; }StartEach: {

if (fwd) Forward();else Backward();fwd = ! fwd;

}

Fast information transfer in L+C

Page 64: Solving Differential Equations in Developmental Models of Multicellular Structures Expressed Using L-systems Pavol Federl and Przemyslaw Prusinkiewicz

Groups:

Production groups in L+C

int phase;Start: { phase=0; }StartEach: {

UseGroup (phase);phase = (phase+1)%3;

}group 0:

A(n): produce A(n+1);group 1:

B(n): produce B(n+1);group 2:

A(n): produce B(n);B(n): produce A(n);

A(0)B(0)A(0)

A(1)B(0)A(1)

A(1)B(1)A(1)

B(1)A(1)B(1)

B(1)A(2)B(1)