{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 300 "Week 1, pages 1-24. Home work assigned: p. 23- 3, 4, 5, 6, 8. You do not turn these in, only d o them and be prepared to do them again on pop tests and exams. Maple commands: dsolve, DEplot (after with(DEtools) ). (In passing we a lso used int and rhs in addition to the Maple help system.)" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 372 "There ar e many features of Maple that make everything easier to do. For examp le, this text was inserted before the Maple commands that were here by ^K [i.e., hold down the control key and the K key at the same time] which inserts a [> before the current group and ^T which switches t o the text mode. While in the text mode you can switch to math mode b y typing ^M: " }{XPPEDIT 18 0 "diff(x(t),t)=y(t)" "/-%%diffG6$-%\"xG6 #%\"tGF)-%\"yG6#F)" }{TEXT -1 34 ". ^T gets you back to text mode." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 170 "dsolve This is the main command. It doesn't always do the job. We talke d a little about systems in class. For example, [I will hit ^J to insert a new group now]" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "d1:=diff(x(t),t)=y(t);d2:=diff(y(t),t)=-x(t);" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 28 "dsolve(\{d1,d2\},\{x(t),y(t)\});" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 19 "The weird symbols _" }{XPPEDIT 18 0 "Cn" "I#CnG6\"" }{TEXT -1 57 " stand for constants. You can insert initial conditions:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "init:=x(0)= 1, y(0)=0;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "dsolve(\{d1,d 2,init\},\{x(t),y(t)\});" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 174 "By t he way, the equations model a mass-spring problem; x is the position and y is the velocity. The equations are linear. Here is an examp le of a nonlinear system. If " }{XPPEDIT 18 0 "epsilon" "I(epsilonG6 \"" }{TEXT -1 113 " is close to zero then the system is in some sense \+ near the first one. Note you can ``recycle'' names of things." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "d1:=diff(x(t),t)=y(t);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 50 "d2:=diff(y(t),t)=-x(t)-epsil on*y(t)*(1+x(t)*y(t));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "d solve(\{d1,d2\},\{x(t),y(t)\});" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 156 "So dsolve couldn't handle the nonlinear system. Still, we can \+ get a lot of qualitive information using Maple. One very powerful pac kage of ``tools'' is:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "wi th(DEtools);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 447 "That is 17 funct ions. You can get help on any of them by using the mouse to highlight a name and then hitting ^F1. This gets you into the help system. W hile there, ^F4 backtracks one level, returning you to where you were \+ eventually. These are easy to remember if you use Alt-F1 and Alt-F4 i n windows. Do it with DEplot now. At the bottom are a number of exam ples. I learned how to use DEplot by studying the examples. Here is \+ an example:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "epsilon:=-1; # I have to set a definite value here." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "DEplot(\{d1,d2\},[x(t),y(t)],t=-2..2,x=-1..1,y=-1..1) ;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 204 "The following example comes directly from the help screen: You just use the mouse to highlight i t, hit ^C, then get out with ^F4, open a new [>, and paste with ^V. Y ou may have to do some minor editing." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 189 "DEplot(\{diff(x(t),t)=x(t)*(1-y(t)),diff(y(t),t)=.3* y(t)*(x(t)-1)\},[x(t),y(t)],t=-2..2,x=-1..2,y=-1..2,arrows=LARGE,title =`Lotka-Volterra model`,\ncolor=[.3*y(t)*(x(t)-1),x(t)*(1-y(t)),.1]); \n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 169 "I don't like the thick arr ows much, and the color is kinda neat but doesn't tell me much. Physi cally, negative x and y don't make sense. Here is a cleaned up pl ot:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 131 "DEplot(\{diff(x(t), t)=x(t)*(1-y(t)),diff(y(t),t)=.3*y(t)*(x(t)-1)\},[x(t),y(t)],t=-2..2,x =0..2,y=0..2,title=`Lotka-Volterra model`);\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 120 "These equations come from the predator-prey problem w hich we discussed in class. x is the prey, y is the predator. " } }{PARA 0 "" 0 "" {TEXT -1 198 " The next problem comes from probl ems 3 and 4. Although the direction field is used there, Maple can so lve the DE. Let's do it for exponents of 1, 2, and 3, and make the eq ulibrium solution " }{XPPEDIT 18 0 "v(t)=8" "/-%\"vG6#%\"tG\"\")" } {TEXT -1 15 " for all three." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "ex:=1;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "dsolve(diff( v(t),t)=1-(v(t)/8)^ex,v(t));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "ex:=2; dsolve(diff(v(t),t)=1-(v(t)/8)^ex,v(t));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "ex:=3; dsolve(diff(v(t),t)=1-(v(t)/ 8)^ex,v(t));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 160 "Note that Maple' s solution, although exact, does not tell you much for exponents of 2 \+ and 3. The direction field, however, tells you exactly what is happen ing." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 97 "T here is another feature worth mentioning. You can grab the output of \+ Maple and use it as input." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 96 "lefthand:=8/3*ln(v(t)-8)-4/3*ln(v(t)^2+8*v(t)+64)-8/3*3^(1/2)*arct an(1/24*(2*v(t)+8)*3^(1/2))+t;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 77 "What I did was copy the left-hand-side of the solution and paste it a s input." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "fortran(lefthan d);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 73 "You can also get C code. \+ I'll show you some more examples of this later." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 60 "DEplot can even take a si ngle equation. Here is an example." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 55 "DEplot(diff(v(t),t)=1-(v(t)/8)^ex,v(t),t=0..2,v=0..16 );" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 10 "Problem 5:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 56 "DEplot(diff(p(t),t)=3*p(t)-2*p(t)^2 ,p(t),t=0..2,p=0..3);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 59 "Problem \+ 6: (this in not the full solution, only the plot)." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 65 "DEplot(diff(y(x),x)=x+sin(y(x)),y(x),x=-2 ..2,y=-2..4,[[0,Pi/2]]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 " " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 32 "Again, this is not the soluti on." }}}}{MARK "0 0 0" 81 }{VIEWOPTS 1 1 0 2 1 1805 }