{VERSION 2 3 "SUN SPARC SOLARIS" "2.3" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 }{CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 } {PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 0 "" 0 "" {TEXT -1 30 "Example: Preditor-Prey. \+ Let " }{XPPEDIT 18 0 "f(t)" "-%\"fG6#%\"tG" }{TEXT -1 30 " be the mass of the foxes and " }{XPPEDIT 18 0 "r(t)" "-%\"rG6#%\"tG" }{TEXT -1 231 " the mass of the rabbits. Imagine the rabbits have an unlimited \+ food supply and the foxes eat only rabbits. Nothing eats the foxes, b ut without food they die exponentially. Similarly, the rabbit populat ion grows exponentially. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 186 "The interaction between foxes and rabbits can be modeled by assuming chance encounters, which would make the growth te rm for foxes and decay term for rabbits proportional to the product." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 72 "restart:df:=diff(f(t),t)= -a*f(t)+b*r(t);\ndr:=diff(r(t),t)=c*r(t)-d*f(t);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "a:=4; b:=1; c:=1; d:=8; init:=f(0)=1, r(0)=5; " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "dsolve(\{dr,df,init\},[ r(t),f(t)]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 54 "notde:=diff (r(f),f)=(c*r(f)-d*r(f)*f)/(-a*f+b*r(f)*f);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "dsolve(notde,r(f));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "solve(\{-a*f+b*r*f=0,c*r-d*r*f=0\},\{r,f\});" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "ppsol:=dsolve(\{df,dr,init\} ,\{f(t),r(t)\},numeric);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "#for i from 0 to 100 by .1 do ppsol(i); od;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "df;dr;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "restart:with(plots):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 55 "x:=1; y:=0.; h:=0.051; pl:=[x,-y]; k:=.5; vx:=0; vy:=0;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 239 "ns:=460: for i to ns do\n l:=sqrt(x^2+y^2): \n if l>1 then\n sf:=k*(l-1)/l:\n xf:=-x*sf:\n yf:=1-y*sf: \n else\n xf:=0:\n yf:=1:\n fi:\n vx:=vx+h*xf:\n vy:=vy+h*yf :\n x:=x+h*vx:\nxx[i]:=x: y:=y+h*vy:\nyy[i]:=-y: pl:=pl,[x,-y]:\nod :" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 63 "pointplot([pl], connec t=true, axes=boxed, scaling=constrained);" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 108 "animate( [t*xx[round(u)],t*yy[round(u)], t=0..1], \+ u=1..ns, color=black, numpoints=2, frames=ns, axes=boxed);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "14 0 0" 0 }{VIEWOPTS 1 1 0 3 2 1804 }