{VERSION 4 0 "IBM INTEL LINUX22" "4.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 256 "" 1 18 0 0 0 0 0 1 1 0 0 0 0 0 0 1 }{CSTYLE "" -1 257 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 259 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 260 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 261 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 262 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "corrected" -1 263 "" 0 0 255 255 0 0 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 264 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 265 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 266 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 267 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 268 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 269 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 270 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 271 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 272 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "red" -1 273 "red" 0 0 255 0 0 1 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 274 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 275 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 276 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 277 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 278 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 279 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 280 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 } {PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Heading 1" -1 3 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 8 4 1 0 1 0 2 2 0 1 }{PSTYLE "Heading 2" -1 4 1 {CSTYLE "" -1 -1 "Times " 1 14 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 8 2 1 0 1 0 2 2 0 1 } {PSTYLE "Bullet Item" -1 15 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 3 3 1 0 1 0 2 2 15 2 }{PSTYLE "Title" -1 18 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 1 2 2 2 1 1 1 1 }3 1 0 0 12 12 1 0 1 0 2 2 19 1 }{PSTYLE "R3 Font 0" -1 256 1 {CSTYLE "" -1 -1 "Courier" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "R3 Font 2" -1 257 1 {CSTYLE "" -1 -1 "Courier" 1 12 0 128 128 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }} {SECT 0 {EXCHG {PARA 18 "" 0 "" {TEXT 256 47 "Mathematical Models: Exa mples for ODEs and PDEs" }{TEXT 274 0 "" }{TEXT 275 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 49 "Ordinary differential equations: population Model" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 187 "We want to model the growth of a populat ion of individuals (e.g. rabbits). In a simple model, the growth of th e population at time t would be proportional to the number of living i ndividu" }{TEXT 263 3 "als" }{TEXT -1 354 " at that time (i.e. constan t birth rate, model of Maltus). However, in this simple model the popu lation would grow without bound. We want to consider a slightly better model, in which we introduce a 'death rate' increasing with the numbe r of living individuals (cf. slide 'Model Refinement 2' from lesson 4) . In this model our population will be bounded." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "with(DE tools):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "with(plots):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 32 "We assume a constant birth rate " }{TEXT 263 1 "b" }{TEXT -1 26 " (per living individuals)." }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 9 "b:=t->b0;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 23 "We want the death rate " }{TEXT 263 1 "d" }{TEXT -1 42 " to increase lin early with the population:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "d:=t- >d0+d1*p(t);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 82 "We get the follow ing ordinary differential equation (ODE) for the population p(t):" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "dgl:=diff(p(t),t)=(b(t)-d(t))*p(t); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 24 "We choose the constants " } {TEXT 263 2 "b0" }{TEXT -1 27 ", d0, d1 and p0 in our ODE " }{TEXT 258 3 "dgl" }{TEXT -1 1 ":" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "smpld ata := \{b0=0.07, d0=0.04, d1=0.0005, p0=6\};" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "dgl1:=subs(smpldata,dgl);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 41 "This ODE is sometimes written in the form" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 24 "p'(t) = a p(t) - b p (t)\262" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 18 "and is called the " }{TEXT 257 17 "Logistic Equation" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 113 "The ODE is very simple (as it can be separated). Maple can sol ve it directly. Note that we use the initial value " }{TEXT 265 7 "p(0 )=p0" }{TEXT -1 29 " to obtain a unique solution." }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 34 "sol := dsolve(\{dgl,p(0)=p0\},p(t));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "pex := unapply(subs(sol,p(t)),t);" }}{PARA 0 "" 0 "" {TEXT 263 50 "(unapply converts our solution to a fu nction of t)" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 32 "We can calculate \+ the limit t -> " }{XPPEDIT 18 0 "infinity" "6#%)infinityG" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 41 "limit (subs(smpldata,pex(t)),t=infinity);" } }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 131 "Before we proceed, we want to d iscuss some basics about ordinary differential equations. In general a first order ODE has the form:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 4 "Let " }{TEXT 260 9 "f: G -> R" }{TEXT -1 92 " be a real continuous function on a subset G of the real plane R \262. We consider the equation" }}{PARA 0 "" 0 "" {TEXT 261 12 "y' = \+ f (t,y)" }{TEXT 264 1 " " }{TEXT -1 6 " " }}{PARA 0 "" 0 "" {TEXT -1 74 "and are interested in differentiable functions y(t) for w hich the equation" }}{PARA 0 "" 0 "" {TEXT 262 17 "y'(t) = f(t,y(t))" }{TEXT -1 1 " " }}{PARA 0 "" 0 "" {TEXT -1 18 "holds for every t." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 68 "A geometr ic interpretation of an ODE is the following. The equation " }{TEXT 267 9 "y'=f(t,y)" }{TEXT -1 43 " defines a direction field. In every p oint " }{TEXT 268 5 "(t,y)" }{TEXT -1 128 " a tangent for y(t) is give n. Every curve y(t) that fits into the direction field is a solution o f the ODE. You can use Maple's " }{TEXT 259 9 "DEplot( )" }{TEXT -1 89 " command to plot the direction field of an ODE. Note that all curv es seem to converge to " }{TEXT 266 4 "p=60" }{TEXT -1 50 ". This corr esponds to the limit calculation above." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "DEplot(dgl1,p(t),t=0..250,p=0..100);" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 86 "If you look at the plot above, it is clear that there i s an infinite number of curves " }{TEXT 263 4 "p(t)" }{TEXT -1 100 " t hat fit into the direction field. But we will obtain a unique solution if we fix an initial value " }{TEXT 269 8 "p(t0)=p0" }{TEXT -1 12 ". \+ We choose " }{TEXT 270 6 "p(0)=6" }{TEXT -1 100 " and plot the directi on field again, this time with the unique solution of the inital value problem:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "DEplot(dgl1,p( t),t=0..250,\{[0,6]\},p=0..100);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 31 "Given an init ial value problem " }{TEXT 271 9 "y'=f(x,y)" }{TEXT -1 2 ", " }{TEXT 272 9 "y(t0)=y0," }{TEXT -1 171 " two important questions arise: The q uestion of existence of solutions and if so the question of uniqueness . We don't want to go into details but only state the following:" }} {PARA 0 "" 0 "" {TEXT -1 236 "A sufficient condition that there is a s olution for the initial value problem is, that the function f is 'Lips chitz-continuous'. This is known as the 'Picard-Lindel\366f-Theorem'. Moreover, under this circumstances the solution is unique." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 102 "For our initia l value problem above the 'Lipschitz-condition' is satisfied and the s olution is unique." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}} {SECT 0 {PARA 3 "" 0 "" {TEXT -1 33 "Exercise: Verhulst, Predator-Prey " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "with(plots):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "with(DEtools):" }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 27 "Solution: \+ Model of Verhulst" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "with(plots):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "with(DEtools):" }}}{PARA 0 "" 0 "" {TEXT -1 50 "Us e Maple to solve the simpler model of Verhulst: " }{XPPEDIT 18 0 "diff (p(t),t) = gamma[0]-delta[0]-(gamma[1]+delta[1])*p(t);" "6#/-%%diffG6$ -%\"pG6#%\"tGF*,(&%&gammaG6#\"\"!\"\"\"&%&deltaG6#F/!\"\"*&,&&F-6#F0F0 &F26#F0F0F0-F(6#F*F0F4" }{TEXT -1 18 ", with parameters " }{XPPEDIT 18 0 "gamma[0]-delta[0] = 6;" "6#/,&&%&gammaG6#\"\"!\"\"\"&%&deltaG6#F (!\"\"\"\"'" }{TEXT -1 5 " and " }{XPPEDIT 18 0 "gamma[1]+delta[1] = 1 /10;" "6#/,&&%&gammaG6#\"\"\"F(&%&deltaG6#F(F(*&F(F(\"#5!\"\"" }{TEXT -1 1 "." }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 61 "First, store the differ ential equation in a variable called " }{TEXT 0 4 "verh" }{TEXT -1 1 "." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "verh := diff(p(t),t) = 6 - 0. 1*p(t);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 142 "Next, use DEplot to d raw the direction field of this ODE (reasonable ranges are t=0..100 an d p=0.120) with a solution curve starting at p(0)=6" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "DEplot(verh, p(t), t=0..100, \{[0,6]\}, p=0..120); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 84 "For this simple ODE, we can e asily compute exact solutions - do this (using Maple's " }{TEXT 0 6 "d solve" }{TEXT -1 2 "):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "dsolve(ve rh, p(t));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 23 "Solution: Predator-Prey" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 146 "Next, we consider a population model with two species, a predator (lions, e.g.) and a prey (gazelles or whatever li ons may eat). Now the numbers " }{XPPEDIT 18 0 "p(t);" "6#-%\"pG6#%\"t G" }{TEXT -1 18 " of predators and " }{XPPEDIT 18 0 "q(t);" "6#-%\"qG6 #%\"tG" }{TEXT -1 108 " of prey relate to the respective growth rate. \+ The Lotka-Volterra model assumes a relationship like follows:" }} {PARA 0 "" 0 "" {XPPEDIT 18 0 "diff(p(t),t) = (a[1]+a[3]*q)*p;" "6#/-% %diffG6$-%\"pG6#%\"tGF**&,&&%\"aG6#\"\"\"F0*&&F.6#\"\"$F0%\"qGF0F0F0F( F0" }{TEXT -1 4 " and" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }{XPPEDIT 18 0 "diff(q(t),t) = (a[4]+a[5]*p)*q;" "6#/-%%diffG6$-%\"qG6#%\"tGF**&,&&% \"aG6#\"\"%\"\"\"*&&F.6#\"\"&F1%\"pGF1F1F1F(F1" }}{PARA 0 "" 0 "" {TEXT -1 5 "with " }{XPPEDIT 18 0 "0 < a[3];" "6#2\"\"!&%\"aG6#\"\"$" }{TEXT -1 37 " (predators need something to eat), " }{XPPEDIT 18 0 "a [5]<0;" "6#2&%\"aG6#\"\"&\"\"!" }{TEXT -1 32 " (more predators eat mor e prey)." }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "with(pl ots):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "with(DEtools):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 47 "Store the two equations above in the vari ables " }{TEXT 0 2 "L1" }{TEXT -1 5 " and " }{TEXT 0 2 "L2" }{TEXT -1 15 ", respectively:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "L1 := diff(p (t),t) = (a1+a3*q(t))*p(t);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "L2 : = diff(q(t),t) = (a4+a5*p(t))*q(t);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 13 "Define a set " }{TEXT 0 3 "sys" }{TEXT -1 36 " of the two equat ions, substituting " }{TEXT 0 7 "a1=-1/2" }{TEXT -1 2 ", " }{TEXT 0 6 "a4=1/5" }{TEXT -1 2 ", " }{TEXT 0 8 "a3=1/200" }{TEXT -1 2 ", " } {TEXT 0 8 "a5=-1/50" }{TEXT -1 118 " (of course, you can choose parame ters of your own, if you like, but I recommend starting with the value s given here):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 56 "sys := subs(\{a1= -1/2,a4=1/5,a3=1/200,a5=-1/50\},\{L1,L2\});" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 52 "Draw a plot of the directional field for the system " } {TEXT 0 3 "sys" }{TEXT -1 7 " using " }{TEXT 0 6 "DEplot" }{TEXT -1 65 " (Hint: you have to specify a range for the independent variable \+ " }{TEXT 277 1 "t" }{TEXT -1 74 ", even if this range does not affect \+ the plot as the axes now are labeled " }{TEXT 276 1 "p" }{TEXT -1 5 " \+ and " }{TEXT 278 1 "q" }{TEXT -1 57 ". For the coefficients from above , reasonable ranges for " }{TEXT 279 1 "p" }{TEXT -1 5 " and " }{TEXT 280 1 "q" }{TEXT -1 24 " are p=0..30, q=0..200):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "DEplot(sys,[p,q],t=0..50,p=0..30,q=0..200);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 96 "Maple is not able to give us the e xact solution of this set of ODEs but it (i.e. its procedure " } {TEXT 0 6 "DEplot" }{TEXT -1 122 ") can compute solution curves for gi ven initial values numerically (we will learn more about this in the n ext worksheet). " }}{PARA 15 "" 0 "" {TEXT -1 284 "You have to specify a set of initial conditions, say p(0)=6, q(0)=50. In the call to DEpl ot, they are specified between the range for t and the ranges for p an d q as a list containing a list of the two conditions (which simply me ans: with a double pair of brackets [...] around them)." }}{PARA 15 " " 0 "" {TEXT -1 85 "Now the range for t affects the plot (in which way ?). A reasonable range is t=0..100." }}{PARA 15 "" 0 "" {TEXT -1 117 " You should specify a stepsize for the numerical computation - a stepsi ze of 0.2 will result in a fairly smooth curve." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 75 "DEplot(sys,[p,q],t=0..50,[[p(0)=6,q(0)=50]],p=0..30,q =0..200,stepsize=0.2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 121 "You ca n use the additional keyword scene=[t,p] in DEplot to get a plot of th e number of predators versus the time axis t." }}{PARA 0 "" 0 "" {TEXT -1 146 "Do this (using the procedure display) to produce a plot \+ containing the two curves 'number of predators' and 'number of prey' v ersus the time axis." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 93 "p1 := DEplo t(sys,[p,q],t=0..100,[[p(0)=6,q(0)=50]],stepsize=0.2, scene=[t,p], lin ecolor=red):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 93 "p2 := DEplot(sys,[p ,q],t=0..100,[[p(0)=6,q(0)=50]],stepsize=0.2, scene=[t,q],linecolor=bl ue):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "display([p1,p2]);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}}}}{MARK "3 3 8 1 0" 146 } {VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }