{VERSION 3 0 "IBM INTEL NT" "3.0" } {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 } {CSTYLE "" -1 256 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 257 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 18 258 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 260 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE " " -1 261 "" 1 18 0 0 0 0 0 0 1 0 0 0 0 0 0 }{CSTYLE "" -1 262 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 263 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 264 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 265 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 266 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 267 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 268 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 269 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE " " -1 270 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 271 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 272 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 273 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 274 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 275 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 276 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 277 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 278 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE " " -1 279 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 280 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 281 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 282 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 } {CSTYLE "" 18 283 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 284 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 285 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 286 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 287 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE " " -1 288 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 289 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 290 "" 1 18 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 }{PSTYLE "Heading 1" 0 3 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 }1 0 0 0 8 4 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 2" 3 4 1 {CSTYLE "" -1 -1 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 8 2 0 0 0 0 0 0 -1 0 }{PSTYLE "Map le Plot" 0 13 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Title" 0 18 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 1 0 0 0 0 0 0 }3 0 0 -1 12 12 0 0 0 0 0 0 19 0 }{PSTYLE "Author" 0 19 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 0 0 -1 8 8 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 18 "" 0 "" {TEXT -1 36 "Direction Fields and Solution Curves" }}{PARA 19 "" 0 "" {TEXT -1 51 "by Dr. Fadyn--Southern Polytechnic State University" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 14 " Introd uction" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 256 130 "Here are three examples of drawing slope fields (or direction fields) of first-order equations using Maple. T he first example is " }{XPPEDIT 256 0 "diff(y(x),x) = x^2-y" "6#/-%%di ffG6$-%\"yG6#%\"xGF*,&*$F*\"\"#\"\"\"F(!\"\"" }{TEXT -1 2 " " }{TEXT 260 9 "which is " }{TEXT -1 1 " " }{TEXT 256 31 "Problem 8 on p. 26 in the text " }{TEXT 261 41 "Differential Equations and Linear Algebra" }{TEXT 262 45 " by Edwards & Penny. The second example is " } {XPPEDIT 257 0 "diff(y(x),x) = x+y;" "6#/-%%diffG6$-%\"yG6#%\"xGF*,&F* \"\"\"F(F," }{TEXT -1 2 " " }{TEXT 258 35 ", (Problem 2 on page 25 i n E&P). " }{TEXT -1 0 "" }{TEXT 257 22 "The third example is " } {TEXT -1 2 " " }{XPPEDIT 256 0 "diff(y(x),x) = y(x)-x;" "6#/-%%diffG6 $-%\"yG6#%\"xGF*,&-F(6#F*\"\"\"F*!\"\"" }{TEXT -1 2 " " }{TEXT 258 78 ", and this example also includes some isoclines for the differenti al equation." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 11 " Exam ple 1" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 263 47 "The differential equation considered here is: \+ " }{XPPEDIT 256 0 "diff(y(x),x) = x^2-y" "6#/-%%diffG6$-%\"yG6#%\"xGF* ,&*$F*\"\"#\"\"\"F(!\"\"" }{TEXT -1 1 " " }{TEXT 264 60 ". First we d efine this equation in Maple, naming it \"eqn8\":" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "eqn8:=diff(y(x),x)=x^2-y(x) ;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 265 290 "Next we will draw a direction field for this diff erential equation. We will use Maple's \"DEplot\" command which resid es in the DEtools package, so first we'll have to call up that package . We'll view the direction field in the window x: -3..3 and y: -3..3. Execute the following commands:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "with(DEtools):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 117 "DEplot(eqn8,y(x),x=-3..3,y=-3..3,c olor=black,title=\"Direction field of dy/dx = x^2 - y\",titlefont=[TI MES,ROMAN,20]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 266 0 "" }}{PARA 0 "" 0 " " {TEXT -1 0 "" }{TEXT 267 103 "You can produce a slopefield of the di fferential equation by using the option \"arrows=line\" as follows:" } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 124 "DEplot(eqn8,y(x),x=-3..3,y=-3..3,color=black,arrows=line,title= \"Slopefield of dy/dx = x^2 - y\",titlefont=[TIMES,ROMAN,20]);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" } {TEXT 268 192 "Next let's add two solution curves to our direction fie ld and color them blue. These solution curves pass through the points (0,2) and (1,0) and are produced by Maple using numerical methods:" } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 187 "DEplot(eqn8,y(x),x=-3..3,[[0,2],[1,0]],y=-3..3,color=black,line color=[blue,blue],title=\"Direction Field of dy/dx = x^2 - y with Sol ution Curves\",titlefont=[TIMES,ROMAN,12],stepsize=0.1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 269 193 "The problem in Edwards and Penny gives us a set of points through which we are to sk etch solution curves. This set of points is, of course, just a set of initial conditions which we define by:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 95 "ics:=[[-2.5,1],[-2,1], [-1.5,1],[-1,1],[-0.5,1],[-2,-2],[-1.5,-2],[-1,-2],[0,-2],[1,-2],[2,-2 ]];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 270 494 "W e can actually draw the set of points using Maple's \"disk\" command w hich resides in the \"plottools\" package. We'll use the sequence com mand,\"seq\", to help us here. In that command ics[j] refers to the j 'th element in ics and the number 0.11 is just the radius of our red d isks. We'll define these disks as \"pts\" and our DEplot as \"p8\" an d then just display both together using Maple's \"display\" command wh ich resides in the \"plots\" package. So here is a set of commands to accomplish this:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 48 "pts:=[seq(disk(ics[j],0.10,color=red),j=1..1 1)]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "with(plots):with(pl ottools):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 141 "p8:=DEplot(eq n8,y(x),x=-3..3,y=-3..3,color=black,title=\"Direction Field of dy/dx \+ = x^2 - y With Initial Points\",titlefont=[TIMES,ROMAN,14]):" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "display(p8,pts,scaling=const rained);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 271 526 "Now we'll draw a solution curve through each of the points al ternating the colors as black and blue. First we define a list \"L\" \+ of these colors. Next we define a sequence of DEplots (called \"p8sol s\") which produce solution curves through the initial condition point s. We then define the original DEplot as \"p8orig\". Finally we disp lay both of these, together with \"pts\", using Maple's \"display\" co mmand. The option \"scaling = constrained\" in the display command ma kes the x and y scales equal so that disks look circular." }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 66 "L:=[ black,blue,black,blue,black,blue,black,blue,black,blue,black];" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 189 "p8sols:=[seq(DEplot(eqn8,y( x),x=-3..3,[ics[j]],y=-3..3,linecolor=L[j],title=\"Directionfield of \+ dy/dx = x^2 - y With Solution Curves\",titlefont=[TIMES,ROMAN,12],step size=0.1),j=1..11)]: " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 103 "p8orig:=DEplot(eqn8,y(x),x=-3..3,[[0,2],[1,0]],y=-3..3,color=blac k,linecolor=[blue,blue],stepsize=0.1):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "display(p8sols,pts,p8orig,scaling=constrained);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 272 107 "Now let' s find the exact (analytical) solution of our differential equation us ing Maple's \"dsolve\" command:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "sol:=dsolve(diff(y(x),x)=x^2 -y(x),y(x));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 259 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 260 366 "Note that as x approaches infinity, \+ solutions are \"attracted to\" the parabola y = x^2 - 2x + 2. This i s so because the negative exponential in solution \"sol\" approaches z ero as x approaches infinity. We conclude that this parabola is an as ymptote of all solutions as x approaches infinity. Let's color that p arabola green in our picture and have final look see:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 60 "pp:=plot(x^2-2*x+2,x=-3..3,y=-3..3,color=green ,thickness=3):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "display(p p,p8sols,scaling=constrained);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 11 " Example 2" }} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" } {TEXT 273 49 "Our next example is the differential equation: " } {XPPEDIT 257 0 "diff(y(x),x) = x+y;" "6#/-%%diffG6$-%\"yG6#%\"xGF*,&F* \"\"\"F(F," }{TEXT -1 2 " " }{TEXT 274 3 ". " }{TEXT -1 1 " " } {TEXT 275 585 "This example will use Maple code similar to the first e xample. One difference is that because of the regular placement of th e initial points in the Edwards and Penny problem, it is convenient to obtain these points using Maple's sequence command, \"seq\". We name these points \"ics1\" and \"ics2\" in the Maple code below. Because \+ of these two sets of initial conditions, we also separate our disks in to two sets called \"pts1\" and \"pts2\". You should already be famil iar with most of the Maple commands below from our first example. Thi nk about what each one is doing as you execute it." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "eqn2:=diff(y(x),x)=x+y(x); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "with(DEtools):" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 115 "DEplot(eqn2,y(x),x=-3..3,y= -3..3,color=black,title=\"Direction Field of dy/dx = x + y\",titlefon t=[TIMES,ROMAN,20]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "ics1:=[seq([-2.5+i,2],i=0.. 5)];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "ics2:=[seq([-2.5+i, -1],i=0..5)];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "pts1:=[seq (disk(ics1[j],0.10,color=red),j=1..6)]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "pts2:=[seq(disk(ics2[j],0.10,color=red),j=1..6)]:" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "with(plots):with(plottools) :" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 139 "p2:=DEplot(eqn2,y(x), x=-3..3,y=-3..3,color=black,title=\"Direction Field of dy/dx = x + y \+ With Initial Points\",titlefont=[TIMES,ROMAN,14]):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 42 "display(p2,pts1,pts2,scaling=constrained); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "L1:=[black,blue,red,bla ck,blue,red];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "L2:=[black ,blue,red,black,blue,red];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 209 "p2sols:=[seq(DEplot(eqn2,y(x),x=-3..3,[ics1[j],ics2[j]],y=-3..3,l inecolor=[L1[j],L2[j]],title=\"Direction Field of dy/dx = x + y With \+ Solution Curves\", titlefont =[TIMES,ROMAN,13] , stepsize=0.1),j=1..6) ]: " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "display(p2sols,pt s1,pts2,scaling=constrained);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 276 69 "Now let's look at the analytic solution of our differential equation:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "dsolve(eqn2 ,y(x));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 256 0 "" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 257 203 "Note that as x approache s minus infinity, all solutions approach the straight line y = -x - 1 \+ . So this straight line is as asymptote of all solutions as x approac hes minus infinity. Let's take a look:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 55 "pl:=plot(-x-1,x=-3..3, y=-3..3,color=green,thickness=3):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "display(pl,scaling=constrained);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "display(p2sols,pts1,pts2,pl,scaling=constrained);" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 " " {TEXT -1 11 " Example 3" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 257 22 "The third example is " }{TEXT -1 5 " " }{XPPEDIT 256 0 "d iff(y(x),x) = y(x)-x;" "6#/-%%diffG6$-%\"yG6#%\"xGF*,&-F(6#F*\"\"\"F*! \"\"" }{TEXT -1 2 " " }{TEXT 258 679 ", and this example also include s some isoclines for the differential equation. Isoclines are curves \+ along which solutions have a constant slope. In general, isoclines ar e defined by the equation: dy/dx = m, where m is a constant. So at an y point at which a solution curve crosses this isocline, the slope of \+ the solution curve is m. In our particular problem the isoclines are \+ defined by the curves: y - x = m, or y = x + m. So all the isoclines \+ are straight lines with slope 1 and y-intercept m. First we will defi ne the differential equation as \"eqn1\". In this example, for variet y, we will use Maple's \"dfieldplot\" in the DEtools package to produc e the direction field:" }}{PARA 0 "" 0 "" {TEXT 277 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 14 "with(DEtools):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "with(plots):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "eqn1:=diff(y(x),x)=y(x)-x;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 107 "dfieldplot(eqn1,y(x),x=-7..7,y=-5..5,title=\"Directi on Field of dy/dx = y - x\" ,titlefont=[TIMES,ROMAN,18]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 278 193 "Next we'll def ine a set of isoclines, called \"isoc\", define the plot structure \"i socp\", which is a plot of seven isoclines, and then display this plot structure using Maple's \"display\" command:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "iso:=x+m;" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "isoc:=[seq(x+m,m=-3..3)]; " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 146 "isocp:=plot(isoc,x=-7. .7,-5..5,color=[maroon,orange,black,magenta,green,blue,gold],thickness =3,title=\"Some Isoclines\",titlefont=[TIMES,ROMAN,14]):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "display(isocp);" }}{PARA 13 "" 0 " " {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 279 314 "Now we'll use \"dfieldplot\" again \+ to define a plot sturcture which we call \"field\" which will give us \+ a direction field. We use the option: dirgrid = [25 , 25] , which wi ll give us 25 arrows horizontally and 25 vertically for a total of 625 arrows. Then we display the direction field and the isoclines togeth er:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 161 "field:=dfieldplot(eqn1,y(x),x=-7..7,y=-5..5,arrows=t hin, dirgrid = [25,25], title=\"Direction Field of dy/dx = y - x With \+ Isoclines\" ,titlefont=[TIMES,ROMAN,12]):" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 21 "display(field,isocp);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 280 98 "Next we'l l use Maple's \"dsolve\" command to find an analytic solution to our d ifferential equation:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "dsolve(eqn1,y(x));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 281 261 "Now we'll solve the initial value problem consisting of the d ifferential equation and the initial condition y(0) = 2 and name the r esult \"sol\". The assign commands then assigns the name y(x) to the \+ expression on the right-hand side. Then we plot the solution:" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "sol:=dsolve(\{eqn1,y(0)=2\},y(x));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "assign(sol);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "plot(y(x),x=-6..6,y=-6..6);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT -1 0 "" }{TEXT 282 24 "Note that the solution: " } {XPPEDIT 283 0 "y(x) = x+1+exp(x);" "6#/-%\"yG6#%\"xG,(F'\"\"\"\"\"\"F )-%$expG6#F'F)" }{TEXT -1 2 " " }{TEXT 284 370 "is the exact analytic solution to this initial-value problem. This should be viewed in con trast to the curve through (0,2) which will be produced below by the D Eplot command, which is a numerical approximation to the exact solutio n. Let's continue by \"unassigning\" the variables x, y and t and the n looking at a direction field with solution curves provided by DEplot :" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "x:='x':y:='y':t:='t':" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 202 "DEplot(eqn1,y(x),x=-6..6,y=-6..6,[[0,-2],[0,-4],[0,2 ],[0,6]],stepsize=0.1,arrows=THIN,color=blue,linecolor=red,title=\"Dir ection Field of dy/dx = y - x With Solution Curves\" ,titlefont=[TIMES ,ROMAN,14]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 285 81 "Now let's look at a direction field with some solution curves \+ and some isoclines:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 205 "dircurves:=DEplot(eqn1,y(x),x=-6..6,y=-6 ..6,[[0,-5],[0,2],[0,6]],stepsize=0.1,arrows=THIN,color=gray,linecolor =red,title = \"Direction Field With Isoclines And Solution Curves\" ,t itlefont=[TIMES,ROMAN,12]):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "disp lay(dircurves,isocp);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" } }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 " " }{TEXT 286 172 "Now let's look at several points where the isoclines cross solution curves. We'll illustrate these points with the \"disk \" command which resides in the \"plottools\" package:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "with(p lottools):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "d1:=disk([-.4 2,-3.37],0.12,color=maroon):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 42 "d2:=disk([-.70, -2.66],0.12,color=orange):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "d3:=disk([-1.10 , -2.06],0.12,color=black):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "d4:=disk([-1.78 , -1.75], 0.12,color=magenta):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "d5: =disk([-1.57, 0.50],0.12,color=blue):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "d6:=disk([-0.91, 2.10],0.12,color=gold):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 63 "display(dircurves,isocp,d1,d2,d3,d4 ,d5,d6,scaling=constrained);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 287 331 "Use the \"magnifying glass\" icons at th e top of your screen to increase the size of this plot so that you can see the disks better. So now a question for you: What is the slope \+ of the solution curves at maroon, orange, black, magenta, blue, and go ld points? Think about it for a minute before you open the \"Answer\" section below." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 4 " " 0 "" {TEXT -1 7 " Answer" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 288 274 "The maroon isocline has \+ equation y - x = -3, so the slope of any solution curve which intersec ts the maroon isocline is -3. Using similar reasoning, the slope of t he solution curves at the orange, black, magenta, blue and gold points is: -2, -1 , 0, 2, and 3, respectively." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 289 189 " Here is just one final question for you: What is the asymptote of the solution curves as x approaches minus infinity? Here is one last plo t to help you decide the answer to this question:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 196 "curves:=DE plot(eqn1,y(x),x=-6..6,y=-6..6,[[0,-5],[0,2],[0,6]],stepsize=0.1,arrow s=none,color=blue,linecolor=red,title=\"Isoclines and Solution Curves \+ of dy/dx = y - x\" ,titlefont=[TIMES,ROMAN,12]):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "display(curves,isocp);" }}}{SECT 1 {PARA 4 " " 0 "" {TEXT -1 7 " Answer" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 290 123 "All solution curves appr oach the isocline y - x = 1 (the green line in the plot above) as x \+ approaches negative infinity." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}}{MARK "0 1 0" 0 } {VIEWOPTS 1 1 0 1 1 1803 }