{VERSION 3 0 "SUN SPARC SOLARIS" "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 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 257 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 1 1 1 0 0 0 0 0 0 } {CSTYLE "" -1 260 "" 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 261 "" 0 1 0 0 0 0 1 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 0 "" }{TEXT 256 10 "Week 2. \+ " }{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 318 "Page 28 problems. 8. There are two ways to go. You can write a fancy procedure or just d o each problem from scratch. The manual does the first approach, but \+ a few of you never seem to get it, so let me do all of these with bare hands. Maple makes it easy to copy big code segments, so it isn't as bad as it seems." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 93 "x0:=0: # starting x\ny:=0: # starting y\nx1:=Pi: # last x\nsteps:=1: h:=e valf((x1-x0)/steps):" }{TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 97 "x:=x0:\nfor i to steps do\n yp:=evalf(1.-sin(y)):\n y:=evalf(y+h *yp): \n x:=evalf(x+h):\nod:\nx; y; " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 83 "Now just copy the group over, replace setps by 2, 4, an d 8, and see what you get!" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 93 "x0:=0: # starting x\ny:=0: # starting y\nx1:=Pi: # last x\nstep s:=2: h:=evalf((x1-x0)/steps):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 97 "x :=x0:\nfor i to steps do\n yp:=evalf(1.-sin(y)):\n y:=evalf(y+h*yp): \n x:=evalf(x+h):\nod:\nx; y; " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 93 "x0:=0: # starting x\ny:=0: # starting y\nx1:=Pi: # last x\nsteps:=4: h:=evalf((x1-x0)/steps):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 97 "x:=x0:\nfor i to steps do\n yp:=evalf(1.-sin(y)):\n \+ y:=evalf(y+h*yp): \n x:=evalf(x+h):\nod:\nx; y; " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 93 "x0:=0: # starting x\ny:=0: # starting y \nx1:=Pi: # last x\nsteps:=8: h:=evalf((x1-x0)/steps):" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 97 "x:=x0:\nfor i to steps do\n yp:=evalf(1.-sin( y)):\n y:=evalf(y+h*yp): \n x:=evalf(x+h):\nod:\nx; y; " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 95 "x0:=0: # starting x\ny:=0: # sta rting y\nx1:=Pi: # last x\nsteps:=256: h:=evalf((x1-x0)/steps):" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 97 "x:=x0:\nfor i to steps do\n yp:=ev alf(1.-sin(y)):\n y:=evalf(y+h*yp): \n x:=evalf(x+h):\nod:\nx; y; " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 56 "restart:dsolve(\{diff(y(x ),x)=1-sin(y(x)),y(0)=0\}, y(x));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "evalf(subs(x=Pi,rhs(%)));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 86 "Comment on this! Make a small table for 1, 2, 4, 8, ... \+ steps and stare at the error." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 25 " 13. Not a Maple problem." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 364 "15 \+ and 16. First, the statement preceeding the two paoblems is wrong. C an you see why. [Hint: how do you transfer heat to your environment?] Second, Maple (and you with your bare hands) can solve each of these DEs exactly, so you might wonder why the authors didn't pick some oth er models for physical problems which Maple couldn't solve. Just lazy I'd guess." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 71 "15. They specify \+ h and let the x1 value vary, but that is easy to fix." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 162 "x0:=0: # starting x (t in the pro blem)\ny:=100: # starting y (T in the problem)\nx1:=1: # last x\nh:=0. 1: steps:=round((x1-x0)/h): # round picks the nearest integer" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 92 "x:=x0:\nfor i to steps do\n yp:=ev alf(70-y):\n y:=evalf(y+h*yp): \n x:=evalf(x+h):\nod:\nx; y; " }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 17 "Now do it to t=2." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 128 "x0:=0: # starting x (t in the pro blem)\ny:=100: # starting y (T in the problem)\nx1:=2: # last x\nh:=0. 1: steps:=round((x1-x0)/h):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 92 "x:=x 0:\nfor i to steps do\n yp:=evalf(70-y):\n y:=evalf(y+h*yp): \n x:= evalf(x+h):\nod:\nx; y; " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 44 "16. \+ Just need to make really minor changes." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 171 "restart:\nx0:=0: # starting x (t in the problem)\ny :=100: # starting y (T in the problem)\nx1:=1: # last x\nh:=0.1: steps :=round((x1-x0)/h): # round picks the nearest integer" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 106 "x:=x0:\nfor i to steps do\n yp:=evalf(40^(-4)* (70^4-y^4)):\n y:=evalf(y+h*yp): \n x:=evalf(x+h):\nod:\nx; y; " }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 17 "Now do it to t=2." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 128 "x0:=0: # starting x (t in the problem)\ny:=100: # s tarting y (T in the problem)\nx1:=2: # last x\nh:=0.1: steps:=round((x 1-x0)/h):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 106 "x:=x0:\nfor i to step s do\n yp:=evalf(40^(-4)*(70^4-y^4)):\n y:=evalf(y+h*yp): \n x:=eva lf(x+h):\nod:\nx; y; " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 86 "2.1 Mot ion of Falling Body. No exercises, but be able to do the worked-out e xamples." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 25 "2.2 Separable Equati ons." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 15 "5. Separable? " } {XPPEDIT 18 0 "s^2+diff(s(t),t) = (s+1)/(s*t);" "6#/,&*$%\"sG\"\"#\"\" \"-%%diffG6$-F&6#%\"tGF.F(*&,&F&F(\"\"\"F(F(*&F&F(F.F(!\"\"" }{TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 63 "15. Solve: You have to write the equation in \+ derivative form." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 70 "restart : dsolve((1/y(x))*diff(y(x),x)+y(x)*exp(cos(x))*sin(x)=0,y(x));" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 35 "26. Same as 15 with initial value s" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 53 "dsolve(\{(1+x)*diff(y( x),x)=-sqrt(y(x)),y(0)=1\},y(x));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 63 "s26:=rhs(dsolve(\{(1+x)*diff(y(x),x)=-sqrt(y(x)),y(0) =1\},y(x)));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "e26:=(1+x)* diff(y(x),x)=-sqrt(y(x));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "simplify(subs(y(x)=s26,e26));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "subs(x=0,%); simplify(%);" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 59 "s26a:=1/4*ln(1+x)^2+ln(1+x)+1; # got this with scr een copy" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "simplify(subs(y (x)=s26a,e26));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "subs(x=0 ,%);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "simplify(%);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 39 "So it looks like Maple needs some \+ help." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 20 "28. First solve it." }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 67 "d28:=diff(y(t),t)=2*y(t)-2* y(t)*t; s28:=dsolve(\{d28,y(0)=3\}, y(t));" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 22 "plot(rhs(s28),t=0..4);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 65 "You can see why y'=0 and use the second derivative test ( do it!)." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 107 "31. This is not rea lly a Maple problem, but illustrates how a CAS might get lost finding \+ solutions to DEs." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "d31:=d iff(y(x),x)=(x-3)*(y(x)+1)^(2/3);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "dsolve(d31,y(x));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "dsolve(\{d31, y(0)=-1\},y(x));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 49 "The problem is the solution is not unique at x=0." } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 17 "36. Free Fall. " }{XPPEDIT 18 0 "m;" "6#%\"mG" } {TEXT -1 9 " is mass " }{TEXT 257 0 "" }{TEXT 258 0 "" }{TEXT 259 0 " " }{TEXT 260 12 "(not weight)" }{TEXT 261 0 "" }{TEXT -1 2 ", " } {XPPEDIT 18 0 "g;" "6#%\"gG" }{TEXT -1 26 " is accel of gravity, and \+ " }{XPPEDIT 18 0 "k;" "6#%\"kG" }{TEXT -1 25 " is the drag coefficient ." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "ffde:=m*diff(v(t),t)=m *g-k*v(t); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "m:=100; g:=9 .8; k:=5; vo:=10;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "dsolve (\{ffde,v(0)=vo\},v(t));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "limit(rhs(%),t=infinity);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 25 "37. Compound Interest. " }{XPPEDIT 18 0 "P(t);" "6#-%\"PG6#%\"tG" } {TEXT -1 19 " is amount at time " }{XPPEDIT 18 0 "t;" "6#%\"tG" } {TEXT -1 2 ", " }{XPPEDIT 18 0 "r;" "6#%\"rG" }{TEXT -1 84 " is % int erest rate, Po=$1000. Continuous interest (derive this!) satisfies th e DE" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "cci:=diff(P(t),t)=r /100*P(t);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "scci:=dsolve( \{cci,P(0)=1000\},P(t));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "subs(\{r=5,t=2\},rhs(scci));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "evalf(%);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "soft:=subs(r=5,rhs(scci));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "solve(soft=4000,t);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "evalf(%);" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 114 "The next part (c) has to be solved in 4 steps because \+ the added money is discrete (time) and the DE is continuous." }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 295 "compute amount at 1 year. add 10 00. [start of year 2] compute amount after 1 year with this start. a dd 1000. [start of year 2] compute amount at end. add 1000. [start of year 3] compute amount after 0.5 year. This is the answer. (Of cour se you could write a loop in Maple to do the steps.)" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "f:=t->evalf(exp(t/20));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 42 "(((1000*f(1)+1000)*f(1)+1000)*f(1))*f(.5) ;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "# amt yr 1 + amt 2 + amt 3 amt 3.5" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 53 "Next we ek: linear first order and exact equations. " }}}}{MARK "65 0 0" 53 }{VIEWOPTS 1 1 0 1 1 1803 }