{VERSION 4 0 "IBM INTEL NT" "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 "" -1 256 "" 1 14 0 0 0 0 2 1 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 257 "" 0 18 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 258 "" 1 12 0 0 0 0 0 2 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 261 "" 0 1 0 0 0 0 0 1 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 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 "Normal" -1 256 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 1 2 2 2 2 2 1 1 1 1 }3 1 0 0 0 0 1 0 1 0 2 2 0 1 }} {SECT 0 {EXCHG {PARA 256 "" 0 "" {TEXT 256 22 "Differential Equations " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 257 "Seve ral techniques for solving differential equations are shown, including exact solutions, series solutions, and numerical techniques. The diff erential equations are visualized using several graphics packages, inc luding direction fields and phaseportraits." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 0 {PARA 4 "" 0 "" {TEXT 257 22 "Differential Equations" }}{PARA 4 "" 0 "" {TEXT 258 78 " Maple has tools for solving differential equations and graphing the so lutions." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 65 "The command above clears the varia bles from the previous section." }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 30 "Solving Differential Equations" }}{PARA 0 "" 0 "" {TEXT -1 198 "Ma ple uses a number techniques for solving differential equations, inclu ding exact methods, series techniques, and numerical solutions. First \+ we find the general solution of a differential equation." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "de1 := diff(y(t),t$2) + 4*diff(y(t) ,t) + 4*y(t) = 0;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "dsolve (de1, y(t));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 40 "Next we solve and initial value problem." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 57 " de2 := diff(y(t),t$2) + 4*diff(y(t),t) + 5*y(t) = 15*t^3;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "dsolve(\{de2, y(0) = 5, D(y)(0) = - 2\}, y(t));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 175 "The equation belo w is Bessel's equation of second order, which has well known solutions known as Bessel's functions. We use Maple to show the series solution of this equation." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "de3 : = t^2*diff(y(t),t$2) + t*diff(y(t),t) + (t^2-4)*y(t) = 0;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "dsolve(de3, y(t));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "dsolve(de3, y(t), series);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 69 "We can increase the number of term s generated by the series solution." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "Order := 12:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "dsolve(de3, y(t), series);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 55 "Maple can solve some systems of differential equations." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 107 "sys := \{diff(x(t),t) = 2*x (t) - y(t) - 2*z(t), diff(y(t),t) = x(t) + 2*y(t), diff(z(t),t) = 2*x( t) - z(t)\};" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "dsolve(sys, \{x(t),y(t),z(t)\});" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 255 "Many di fferential equations cannot be solved exactly, but there are numerical methods to solve differential equations. The default method for Maple is the Runge-Kutta Fehlberg 45 method. We use the Lotka-Volterra mode l to demonstrate the numerical solver." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 77 "LVx := diff(x(t),t) = x(t)*(1-y(t));\nLVy := diff(y(t ),t) = 0.3*y(t)*(x(t)-1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 93 "ff := dsolve(\{LVx, LVy, x(0)=0.2, y(0)=1\},\n \{x(t),y(t)\}, type =numeric, output=listprocedure);" }{TEXT -1 0 "" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 41 "fx := subs(ff,x(t)): fy := subs(ff,y(t)):" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 86 "Next we use numerical solution to \+ generate a series of points, which are then graphed." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 51 "LVsoln := [seq([fx(0.1*n),fy(0.1*n)], n = 0..200)]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 96 "plot(LVsoln, \+ title=`Lotka-Volterra Model`, labels=[`prey`,`predator`], color=blue, \+ thickness=2);" }}}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 41 "Graphic Studie s of Differential Equations" }}{PARA 0 "" 0 "" {TEXT -1 86 "Maple has \+ a number of methods for visualizing the solutions of differential equa tions." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "with(DEtools):" }} }{EXCHG {PARA 0 "" 0 "" {TEXT -1 152 "The DEplot routine shows the vec tor field along with some trajectories of the Lotka-Volterra model. Th is is a phaseportrait of this predator-prey model." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 151 "dfieldplot([LVx, LVy], [x(t),y(t)], t=-2.. 2, x=-1..2, y=-1..2, arrows=MEDIUM, title=`Lotka-Volterra model`,\ncol or=[.3*y(t)*(x(t)-1),x(t)*(1-y(t)),.1]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 213 "DEplot([LVx, LVy], [x(t),y(t)], t=0..15, [[x(0)=1.2, y(0)=1.2],[x(0)=1,y(0)=.7]], stepsize=.2,\ntitle=`Lotka-Volterra model `, color = [.3*y(t)*(x(t)-1),x(t)*(1-y(t)),.1],\nlinecolor=t/2, arrows =MEDIUM, method=rkf45);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 150 "Maple has a phaseportrait command. Below we show a 2-D projection of a 3-D \+ plot from the system of equations solved above, using 2 initial condit ions." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 254 "phaseportrait([di ff(x(t),t) = 2*x(t) - y(t) - 2*z(t), diff(y(t),t) = x(t) + 2*y(t), dif f(z(t),t) = 2*x(t) - z(t)], [x(t),y(t),z(t)], t=0..5, [[x(0)=0.1,y(0)= 0,z(0)=0], [x(0)=-0.1,y(0)=0,z(0)=0]], stepsize=.05, scene=[x(t),y(t)] , linecolour=sin(t*Pi/2));\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 148 " Maple also produces 3-D plots of differential equations. Below we show the command that produces the graph show on the opening page of this \+ website." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 54 "oscx := D(x)(t) =y(t);\noscy := D(y)(t)=-x(t)-0.4*y(t); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 293 "DEplot3d(\{oscx, oscy\}, [x(t),y(t)], t=0..10, [[x(0 )=0,y(0)=1], [x(0)=0,y(0)=.5], [x(0)=0,y(0)=-1], [x(0)=0,y(0)=-.5], [x (0)=1,y(0)=0], [x(0)=0.5,y(0)=0], [x(0)=-1,y(0)=0], [x(0)=-0.5,y(0)=0] ], scene=[t,x(t),y(t)], stepsize=.1, title=`Damped Oscillations`, line colour = t-sqrt(t), axes=NORMAL);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 20 "Qualitative Analysis" }}{PARA 0 "" 0 "" {TEXT -1 234 "Below we perform some quali tative analysis for a differential equation. We find equilibria and de termine the eigenvalues (hence behavior) at the equilibria. Consider a modified Lotka-Volterra model, including intraspecies competition." } }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 104 "MLVx := diff(x(t),t) = 0.2 *x(t)*(1 - 0.1*x(t) - 0.2*y(t));\nMLVy := diff(y(t),t) = 0.3*y(t)*(0.3 *x(t)-1);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 43 "We begin by viewing \+ the graph of the model." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 211 "DEplot([MLVx, MLVy], [x(t),y(t)], t=0..50, [[x(0)=1,y(0)=5],[x(0)=1,y (0)=.7]], stepsize=.2,\ntitle=`Lotka-Volterra model`, color = [.3*y(t) *(x(t)-1),x(t)*(1-y(t)),.1],\nlinecolor=t/2, arrows=MEDIUM, method=rkf 45);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 113 "We find the equilibria f or this model by setting the right hand side of the differential equat ions equal to zero." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 57 "equil := solve(\{rhs(MLVx)=0, rhs(MLVy)=0 \}, \{x(t), y(t)\});" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 150 "Linear a nalysis of a differential equation near an equilibrium is best done by finding the eigenvalues for the linearized system near the equilibriu m." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "with(linalg):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 69 "Create a vector for the right hand side of the differential equation. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 69 "A := vector([0.2*X*(1 - 0.1*X - 0.2*Y), \n 0.3*Y*(0.3*X-1)]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 50 "Find the Jacobian matrix for this vector function." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "J := jacobian(A, [X,Y]); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 81 "Analyze the eigenvalues of th e Jacobian matrix near the origin (one equilibrium)." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "X := 0: Y := 0: J0 := J(0,0);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "eigenvects(J0);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 12 "This give a " }{TEXT 259 11 "saddle node" }{TEXT -1 53 " since the eigenvalues are real and opposite in sign." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "X := rhs(equil[3][1]); Y := \+ rhs(equil[3][2]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "J1 := \+ J(X,Y);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "eigenvects(J1); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 12 "This give a " }{TEXT 261 11 " stable node" }{TEXT -1 62 " since the eigenvalues are complex with a n egative real part. " }}{PARA 0 "" 0 "" {TEXT -1 61 "The phase portrait above shows these properties very clearly." }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 0 "" }}}}}}{MARK "2 4" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }