solving differential equations in developmental models of multicellular structures expressed using...
TRANSCRIPT
Solving Differential Equations in Developmental Models of Multicellular Structures
Expressed Using L-systems
Pavol Federl and Przemyslaw PrusinkiewiczUniversity of Calgary
Anabaena
heterocyst cellsheterocyst cells vegetative cellsvegetative cells
Anabaena
Anabaena – continuous model
)(
)(
)2(
max
max
ssrdt
ds
ccrdt
dc
rsdt
ds
ccccDdt
dc
s
c
rl
Vegetative cells:
Heterocysts:
L+C1 = combination of L-systems and C++
1. Karwowski and Prusinkiewicz 2002
Review of L-systems and L+C
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
B(0)AAAAAAA
Standard information transfer
B(n)< A : produce B(n+1);
B(0)AAAAAAA
B(0)B(1)AAAAAA
Standard information transfer
B(n)< A : produce B(n+1);
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);
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);
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);
Fast information transfer in L+C
B(n)<< A : produce B(n+1);
new left context
B(0) A A A A A A A
B(n)<< A : produce B(n+1);
Fast information transfer in L+C
B(0) A A A A A A A
B(0)
B(n)<< A : produce B(n+1);
Fast information transfer in L+C
B(0) A A A A A A A
B(0)
B(n)<< A : produce B(n+1);
Fast information transfer in L+C
B(0) A A A A A A A
B(0)
B(n)<< A : produce B(n+1);
Fast information transfer in L+C
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
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
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
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
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
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
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
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
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
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.
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
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)
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
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
Tri-diagonal system of LEs
A Y
A Y
Gaussian elimination
Gaussian elimination
A Y
Gaussian elimination
A Y
Gaussian elimination
A Y
Gaussian elimination
A Y
Gaussian elimination
A Y
Gaussian elimination
A Y
Gaussian elimination
A Y
Gaussian elimination
A Y
Gaussian elimination
A Y
Gaussian elimination
A Y
Gaussian elimination
A Y
Gaussian elimination
A Y
Gaussian elimination
A Y
Gaussian elimination
A Y
Gaussian elimination
A Y
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
……
Phase I Phase II
…… …… ……
L-system implementation
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);
}
struct CD { double s, con, a, b, c, y; bool h; }module C (struct CD);
Anabaena in L+C
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
Animation
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
END
Introduction
Information transfer (diffusion)
Dynamically evolving systems of ODEs
L-systems1
External vs. internal solver
Anabaena
1. Lindenmayer 1968
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)
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
C C C C C C Ct
C C C C C C Ctt
iir
iil
ii
CCCCDt
CC
)2(1
Explicit scheme
Anabaena – continuous model
Anabaena
Heterocyst spacing relatively constantHeterocyst cells
produce compoundVegetative cells
dividedifferentiateconsume compounddiffuse compound
C C C C C C Ct
C C C C C C Ctt
Implicit scheme
11111
)2(
ii
rii
l
ii
CCCCDt
CC
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
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)