{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 "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 "LaTeX" -1 32 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 263 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 264 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 265 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 266 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 267 "" 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 "Heading 1" -1 256 1 {CSTYLE "" -1 -1 "Times" 1 12 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 }} {SECT 0 {EXCHG {PARA 3 "" 0 "" {TEXT -1 48 "Single First-order Differe ntial Equation Example" }}}{EXCHG {PARA 4 "" 0 "" {TEXT -1 18 "Initial izing Maple" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT -1 71 "It is a good idea to re-initialize the Maple \"kernel\" at the beginning:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" } {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT -1 47 "Now we load the Differential Equations package:" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "with( DEtools ):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 4 "" 0 "" {TEXT -1 21 "Drawing a Slope Field" }{TEXT 32 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 73 "As an ex ample, we consider the simple first-order differential equation " } {XPPEDIT 18 0 "diff(y(t),t) = t^2-y;" "6#/-%%diffG6$-%\"yG6#%\"tGF*,&* $F*\"\"#\"\"\"F(!\"\"" }{TEXT -1 32 " and assign it to the variable \+ " }{TEXT 0 2 "de" }{TEXT -1 137 " so that we don't have to write it ev ery time. Note that Maple \"keeps us honest\" about the unknown funct ion -- we are required to enter " }{TEXT 0 4 "y(t)" }{TEXT -1 49 " ins tead of the sloppy (but widespread) shortcut " }{TEXT 0 1 "y" }{TEXT -1 1 ":" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "de := diff(y(t),t) = t^2 - y(t);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 148 "The following command displays (be patient!) the slope f ield of the above differential equation in the appropriate ranges (the ranges are required):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "dfieldplo t( de, y(t), t=-2..2, y=-3..3 );" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 179 "One can change the appearance of \+ the slope markers. The following command displays the same slope fiel d, but changes the slope markers from red arrows (default) to magenta \+ lines:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 69 "dfieldplot( de, y (t), t=-2..2, y=-3..3, arrows=LINE, color=magenta );" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 4 "" 0 "" {TEXT -1 16 "Drawing Solutio n" }{TEXT 32 1 "s" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT -1 78 "The following command plots the solution that sati sfies the initial condition " }{TEXT 263 1 "y" }{TEXT -1 36 "(-1) = 1, on top of the slope field:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "phas eportrait( de, y(t), t=-2..2, [[y(-1)=1]] );" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 148 "Maple can plot more th an one solution on the same plot. The following command plots three s olutions corresponding to the three initial conditions: " }{TEXT 264 1 "y" }{TEXT -1 11 "(0) = 0.5, " }{TEXT 266 1 "y" }{TEXT -1 13 "(0) = \+ 1, and " }{TEXT 267 1 "y" }{TEXT -1 147 "(0) = 1.5. Note the brackets around each condition and around the entire list below (now you under stand the double brackets in the example above)." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 71 "phaseportrait( de, y(t), t=-2..2, [[y(0)=0.5], [y(0)= 1], [y(0)=1.5]] );" }}}{EXCHG {PARA 4 "" 0 "" {TEXT -1 19 "Making It P retty..." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 254 "It is more convenient to save (in addition to the differ ential equation itself) the t-range, the inititial conditions, and oth er expressions for later use. The following lines produce the same ou tput as above, but are much easier to read and understand:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 99 "trng := t=-2..2;\nics := [ [y(0)=0. 5], [y(0)=1], [y(0)=1.5] ];\nphaseportrait( de, y(t), trng, ics );" }} }{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 319 " One can change a lot of the features of the plot that Maple produces. \+ The following command produces the same plot as above, but adds an ap propriate title, plots the slopes as gray lines (instead of the defaul t red arrows), and draws the solution curves in red, magenta, and maro on (instead of the default gold color):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 124 "phaseportrait( de, y(t), trng, ics, title=\"Asymptotic soluti ons\", arrows=LINE, color=gray, linecolor=[red,magenta,maroon] );" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 64 "To plot only the solution curves (without the slope field), use " }{TEXT 0 11 "arrows=NONE" }{TEXT -1 1 ":" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 96 "phaseportrait( de, y(t), trng, ics, title=\"Asymptoti c solutions\", arrows=NONE, linecolor=blue );" }{TEXT -1 0 "" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 72 "Fo r further information on DE plotting, execute the following help line: " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "?DEplot;" }{TEXT -1 0 "" }}} {EXCHG {PARA 0 "" 0 "" {TEXT 265 0 "" }}{PARA 0 "" 0 "" {TEXT -1 73 "N ow do it yourself by changing stuff around and enjoy the power of Mapl e!" }}}{PARA 256 "" 0 "" {TEXT -1 0 "" }}}{MARK "2 2 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }