Cmputatinal mdeling techniques Lecture 11: Mdeling with systems f ODEs In Petre Department f IT, Ab Akademi http://www.users.ab.fi/ipetre/cmpmd/
Mdeling with differential equatins Mdeling strategy Fcus n the change in the values f all variables We describe the change as a functin f the current values f all variables If the prcess is deterministic and it takes place cntinuusly in time, the mdel may be frmulated in terms f differential equatins Octber 6, 2014 Cmputatinal mdeling techniques 2
Systems f differential equatins Very ften, mdels describe interactive situatins: several variables invlved, their change depends n all the ther variables An animal may serve as prey fr anther Tw species may depend n each ther fr mutual supprt Tw r mre species may cmpete fr the same resurce Mdel thrugh a system f differential equatins Each equatin gives the rate f change f ne variable as a functin f the current values f all variables Slve all equatins simultaneusly Bad news: the equatins are ften nn-linear and in general they cannt be slved analytically Gd news: many numerical techniques exist t analyze the behavir f such (systems f) equatins Octber 6, 2014 Cmputatinal mdeling techniques 3
Cntent Basic ntins Graphical slutins Examples cmpetitive hunter mdel predatr-prey mdel ecnmic aspects f an arms race Octber 6, 2014 Cmputatinal mdeling techniques 4
Autnmus systems f ODEs Definitin. A system f ODEs f the frm dx i /dt=f i (x 1,x 2, x n ) is called autnmus In ther wrds, n independent variable t n the right hand side the system is nt time-dependent; it nly depends n the variatin f its variables Octber 6, 2014 Cmputatinal mdeling techniques 5
Equilibria Equilibrium pints / steady states A system f ODEs dx i /dt=f i (x 1,x 2, x n ), i=1,2,,n a=(a 1,a 2,,a n ) is an equilibrium pint fr the system if f i (a)=0, fr all i Equivalently, if x i (0)=a i, fr all i, then the system has a slutin the cnstant functins x i (t)=a i Stable equilibrium a is stable if it is true that x(0) being clse t a implies that x(t) is clse t a, fr all t>0 a is called unstable therwise Asympttically stable a is asympttically stable if it is true that x(0) being clse t a implies that lim t x(t)=a Octber 6, 2014 Cmputatinal mdeling techniques 6
Lyapunv stability (ptinal slide) Cnsider an autnmus dynamical system dy/dx=f(y(x)), y(0)=y 0, where f:r n R n is cntinuus and has an equilibrium y e The equilibrium is (Lyapunv) stable if, fr every ε>0, there exists δ ε >0 such that, if y 0 -y e <δ ε, then y(x)-y e <ε, fr all x 0 The equilibrium is asympttically stable if there exists δ>0 such that, if y 0 -y e <δ, then lim x y(x)-y e =0 Octber 6, 2014 Cmputatinal mdeling techniques 7
Graphical slutins Cnsider autnmus systems f first-rder ODEs dx i /dt=f i (x 1,x 2, x n ) nt time dependent cnsider its slutin as describing a trajectry in the n-dimensinal plane, with crdinates (x 1 (t),x 2 (t), x n (t)) the n-dimensinal plane (x 1,x 2, x n ) is called a phase plane cnvenient t think abut it as the mvement f a particle autnmus system implies that the directin f mvement frm a given pint n the trajectry nly depends n that pint, nt n the time when the particle arrived in that pint Cnsequence: n trajectry can crss itself unless it is a clsed curve (peridic) Cnsequence: at mst ne trajectry ging thrugh any given pint Equivalently: tw different trajectries cannt intersect Octber 6, 2014 Cmputatinal mdeling techniques 8
Graphical slutins Cnsider autnmus systems f first-rder ODEs dx i /dt=f i (x 1,x 2, x n ) if (e 1,e 2, e n ) is an equilibrium pint, then the nly trajectry ging thrugh that pint is the cnstant ne Cnsequence: a trajectry that starts utside an equilibrium pint can nly reach the equilibrium asympttically, nt in a finite amunt f time A nn-cnstant mtin f a particle can have ne f the fllwing 3 behavirs: appraches an equilibrium pint mves alng r appraches asympttically a clsed path at least ne f the trajectry cmpnents becmes arbitrarily large as t tends t infinity Octber 6, 2014 Cmputatinal mdeling techniques 9
Example dx/dt=-x+y, dy/dt=-x-y Analytic slutin: x(t)=e -t sin(t), y(t)=e -t cs(t) Equilibrium pint: dx/dt=dy/dt=0 leads t x=y=0 Nte: x 2 (t)+y 2 (t)=e -2t, i.e., the trajectry is a circular spiral with decreasing radius appraching 0 Girdan et al. A first curse in mathematical mdeling. (3 rd editin), Page 415 Octber 6, 2014 Cmputatinal mdeling techniques 10
Example: a cmpetitive hunter mdel Assume we have a small pnd that we desire t stck with game fish, say trut and bass. The prblem we want t slve is whether it is pssible fr the tw species t cexist Hypthesis Unlimited amunt f fd available The space is a limitatin fr the c-existance f the tw species The mre there is f the ther species, the smaller the grwth rate; Assume the causes t be in the cmpetitin fr space mdel it as prprtinal in the number f pssible interactins between the tw species Mdel frmulatin The change in the level f trut X(t): dx/dt = ax(t) bx(t)y(t) Similar reasning fr the level f bass Y(t): dy/dt=my(t) nx(t)y(t) Octber 6, 2014 Cmputatinal mdeling techniques 11
Example: a cmpetitive hunter mdel Mdel: dx/dt = ax(t) bx(t)y(t), dy/dt=my(t) nx(t)y(t) Questin: can the tw ppulatins reach an equilibrium where bth are nn-zer Answer: ax-bxy=0, my-nxy=0 Slutin: either x=y=0, r x=m/n, y=a/b Difficulty: impssible t start with exactly the equilibrium values (they might nt even be integers) s, we cannt expect t start in an equilibrium pint study the prperty f the equilibrium, hping it is a stable ne Octber 6, 2014 Cmputatinal mdeling techniques 12
Equilibrium pints: (0,0), (m/n, a/b) Additinal questin: what is the behavir if we start clse t the equilibrium pint? Example: a cmpetitive hunter mdel (cntinued) dx/dt = ax(t) bx(t)y(t), dy/dt=my(t) nx(t)y(t) Slutin: we study the tendency f X(t), Y(t) t increase/decrease arund the equilibrium pint. Fr this, we study the sign f the derivatives f X(t), Y(t) dx/dt 0 ax-bxy 0 a/b Y dy/dt 0 my-nxy 0 m/n X Girdan et al. A first curse in mathematical mdeling. (3 rd editin), Page 421 Octber 6, 2014 Cmputatinal mdeling techniques 13
Bass Y a/b m/n X Trut Bass Y a/b m/n X Trut Octber 6, 2014 Cmputatinal mdeling techniques 14
Graphical analysis f the trajectry directins Y Bass a/b m/n Trut X Octber 6, 2014 Cmputatinal mdeling techniques 15
Graphical analysis f the trajectry directins arund the equilibria Y Bass a/b m/n Trut X Octber 6, 2014 Cmputatinal mdeling techniques 16
Y Graphical analysis f the trajectry directins Bass a/b Bass win Trut win m/n X Cnclusin: the c-existance f the tw species is highly imprbable Octber 6, 2014 Cmputatinal mdeling techniques 17
Limits f graphical analysis Nt always pssible t determine the nature f the mtin near an equilibrium based n graphical analysis Example: the behavir in Fig 11.9 thrugh graphical analysis is satisfied by all 3 trajectries in Fig 11.10 Example: The trajectry in Fig 11.10c culd be either grwing unbundedly r apprach a clsed curve Girdan et al. A first curse in mathematical mdeling. (3 rd editin), Page 422-423 Octber 6, 2014 Cmputatinal mdeling techniques 18
A predatr-prey mdel Als knwn as the Ltka-Vlterra mdel, (1910-1926) A mdel where we have tw species, ne being the primary fd surce fr the ther: predatr-prey mdel Histrical references: used in chemistry, eclgy, bimathematics, ecnmy Hypthesis The prey ppulatin finds unlimited amunt f fd at all times The fd supply f the predatr ppulatin depends entirely n the size f the prey ppulatin Grwth rate f each ppulatin taken in islatin is prprtinal t its size Predatrs have limitless appetite Octber 6, 2014 Cmputatinal mdeling techniques 19
A predatr-prey mdel: whales vs. krill Assumptins and mdel frmulatin (the Ltka-Vlterra mdel, 1910-1926) The krill ppulatin x Assume that the cean supprts an indefinite grwth f the krill (we d nt mdel explicitly the planktn) The ppulatin declines prprtinally t the number f interactins between krill and whales dx/dt=ax-bxy The whale ppulatin y Whale die f natural causes; cnstant mrtality rate Whales reprduce at a rate prprtinal t the number f interactins between krill and whales dy/dt=-my+nxy Equilibrium pints dx/dt=dy/dt=0 (x,y)=(m/n,a/b) r (x,y)=(0,0) Octber 6, 2014 Cmputatinal mdeling techniques 20
A predatr-prey mdel: graphical analysis Girdan et al. A first curse in mathematical mdeling. (3 rd editin), Page 430 Cnclusin: fr the analysis f the behavir arund the nn-zer pint we need further analysis: is it peridic, (asympttically) stable, r unstable? Octber 6, 2014 Cmputatinal mdeling techniques 21
Predatr-prey mdel: analytic slutin Nte: analytic slutin pssible in this case it reveals the peridic behavir f the mdel skip it here; nly lk at the results f the numerical integratin Octber 6, 2014 Cmputatinal mdeling techniques 22
A predatr-prey mdel: numerical integratin 350 300 250 200 150 100 50 0 1 59 117 175 233 291 349 407 465 523 581 639 697 755 813 871 929 987 1045 1103 1161 1219 1277 1335 1393 1451 1509 1567 1625 1683 1741 1799 1857 1915 1973 Octber 6, 2014 Cmputatinal mdeling techniques 23
A predatr-prey mdel: phase prtrait 350 300 250 200 150 100 50 0 0 20 40 60 80 100 120 140 160 180 Octber 6, 2014 Cmputatinal mdeling techniques 24
A predatr-prey mdel: numerical integratin Girdan et al. A first curse in mathematical mdeling. (3 rd editin), Page 432-433 Octber 6, 2014 Cmputatinal mdeling techniques 25
Example: Ecnmic aspects f an arms race Prblem. Tw cuntries engaged in an arms race. Interested in whether the arms race will lead t uncntrlled spending and eventual win by the cuntry with better ecnmic assets Assumptins x is the annual defense expenditures f cuntry 1, y f cuntry 2 Driving factrs fr rate f increase f the defense budget x the bigger it is, the less it shuld grw: negative influence assumed t be prprtinal t its current budget x (ecnmic cnstraint) the bigger the budget f the adversary, the mre it shuld increase: psitive influence assumed t be prprtinal the current budget f the adversary y (military cnstraint) sme cnstant level f grwth is needed anyway (precautinary cnstraint) Mdel dx/dt=-ax+by+c dy/dt=mx-ny+p Octber 6, 2014 Cmputatinal mdeling techniques 26
Example: Ecnmic aspects f an arms race (cntinued) Mdel dx/dt=-ax+by+c dy/dt=mx-ny+p Equilibrium pint: -ax+by+c=0; mx-ny+p=0 x=(bp+cn)/(an-bm), y=(ap+cm)/(anbm) Just t make a chice in drawing the plts, assume that an-bm>0 Plt the tw lines and cnsider the intersectin f the tw half planes Girdan et al. A first curse in mathematical mdeling. (3 rd editin), Page 447 Regin A: dx/dt>0, dy/dt<0 Regin B: dx/dt<0, dy/dt<0 Regin C: dx/dt>0, dy/dt>0 Regin D: dx/dt<0, dy/dt>0 Octber 6, 2014 Cmputatinal mdeling techniques 27
Example: Ecnmic aspects f an arms race (cntinued) dx/dt=-ax+by+c dy/dt=mx-ny+p Regin A: dx/dt>0, dy/dt<0 Regin B: dx/dt<0, dy/dt<0 Regin C: dx/dt>0, dy/dt>0 Regin D: dx/dt<0, dy/dt>0 Cnclusin: asympttically stable pint Girdan et al. A first curse in mathematical mdeling. (3 rd editin), Page 447 Octber 6, 2014 Cmputatinal mdeling techniques 28
Learning bjectives Be able t frmulate the evlutin f change in terms f an ODE-based mdel Be able t identify the equilibrium pints f simple ODE-base mdels Understand the cncepts f stable, asympttically stable equilibrium pints Octber 6, 2014 Cmputatinal mdeling techniques 29