{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 19 "5.4 p. 266 4, 6" }} {PARA 0 "" 0 "" {TEXT -1 16 "5.5 p. 274 7" }}{PARA 0 "" 0 "" {TEXT -1 20 "5.6 p. 284 1, 14" }}{PARA 0 "" 0 "" {TEXT -1 35 "5.7 \+ p. 297 2, 9, 21, 31, 34, 36" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 9 "p. 266 #5" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 173 "s5:=\{diff(x (t),t,t)=-x(t)+diff(y(t),t)-diff(x(t),t),\n diff(y(t),t,t)=-y(t)-d iff(y(t),t)+diff(x(t),t),\n y(0)=0, x(0)=2, D(y)(0)=0, D(x)(0)=0\} ;\ndsolve(s5,\{x(t),y(t)\});" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 79 "plot(\{t*exp(-t)+cos(t)+exp(-t), cos(t)-exp(-t)-t*exp(-t)\},t=0. .30,color=black);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 58 "p. 274 #5 \+ Series RLC, e(t)=E0 cos(gt) R=10, L=4, C=0.01" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 127 "L:=4; R:=10; C:=1/100;\nd5:=\{L*diff(q(t),t,t )+R*diff(q(t),t)+1/C*q(t)=diff(cos(g*t),t), q(0)=0, D(q)(0)=0\};\ns5:= dsolve(d5,q(t));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "s5:=dso lve(d5,q(t),laplace);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "g: =4; g4:=plot(rhs(s5[1]),t=0..6,color=blue):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 57 "g:=5/4*sqrt(15); g6:=plot(rhs(s5[1]),t=0..6,color= green):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 91 "g:=2; g2:=plot(r hs(s5[1]),t=0..6,color=black):\ng:=8; g8:=plot(rhs(s5[1]),t=0..6,color =red):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "with(plots): disp lay(\{g2,g8,g4,g6\});" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 128 "g :='g';syse:=\{diff(q(t),t)=i(t), 4*diff(i(t),t)+10*i(t)+100*q(t)=cos(g *t), i(0)=0,q(0)=0\};\ns5:=dsolve(syse,\{i(t),q(t)\},laplace);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 10 "p. 274 #11" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 175 "sys11:=\{diff(q(t),t)=i2(t), -20*diff(i1(t)-i 2(t),t)+5*i2(t)+30*q(t)=0, 10*i1(t)+20*diff(i1(t)-i2(t),t)=10, q(0)=0, i1(0)=0, i2(0)=0\};\ndsolve(sys11,\{q(t),i1(t),i2(t)\},laplace);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "plot(-4/5*exp(-3/2*t)+4/5*ex p(-2/3*t),t=0..8);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 9 "p. 284 #5" } }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 84 "The equation is second order, so there will be two first order equations. They are:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 99 "d1:=diff(x1(t),t)=x2(t); d2:=diff(x2(t),t )=(1/3/t^2)*(5*t*x2(t)-5*x1(t)); init:=x1(1)=0, x2(1)=2/3;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "dsolve(\{d1,d2,init\},\{x1(t),x2(t) \});" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "-8+8^(5./3);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 101 "So Maple can solve the system. L et's write a Runge-Kutta routine. That is the point of the problem." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 474 "x1:=0.: x2:=2./3.: h:=0. 125: t:=1.: # the starting stuff\nM:=(8-t)/h: \nfor i from 1 to M do\n k11:=h*x2:\n k12:=h*(1/3/t^2)*(5*t*x2-5*x1):\n k21:=h*(x2+k12/2): \n k22:=h*(1/3/(t+h/2)^2)*(5*(t+h/2)*(x2+k12/2)-5*(x1+k11/2)):\n k31 :=h*(x2+k22/2):\n k32:=h*(1/3/(t+h/2)^2)*(5*(t+h/2)*(x2+k22/2)-5*(x1+ k21/2)):\n k41:=h*(x2+k32):\n k42:=h*(1/3/(t+h)^2)*(5*(t+h)*(x2+k32) -5*(x1+k31)):\n t:=t+h:\n x1:=x1+(k11+2*k21+2*k31+k41)/6:\n x2:=x2+ (k12+2*k22+2*k32+k42)/6:\nod:\nprint(t,x1,x2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 43 "Not bad, considering the big step size 0.5." }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 76 "The next one is a linear system wi th constant coefficients and no explicit " }{XPPEDIT 18 0 "t " "I\"t G6\"" }{TEXT -1 13 " dependence." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 10 "p. 284 #15" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 85 "restart:s ys:=\{diff(x(t),t)=2*x(t)-y(t), diff(y(t),t)=3*x(t)+6*y(t), x(0)=0, y( 0)=-2\};" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "dsolve(sys,\{x( t),y(t)\});" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "evalf(subs(t =1,\"));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 17 "Now do it by R-K:" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "dx:=(x,y)->2*x-y; dy:=(x,y) ->3*x+6*y;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "dx(1,Pi);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 342 "x:=0: y:=-2.: h:=1/160.: M: =1/h: \nfor i from 1 to M do\n kx1:=h*dx(x,y):\n ky1:=h*dy(x,y):\n \+ kx2:=h*dx(x+kx1/2,y+ky1/2):\n ky2:=h*dy(x+kx1/2,y+ky1/2):\n kx3:=h*d x(x+kx2/2,y+ky2/2):\n ky3:=h*dy(x+kx2/2,y+ky2/2):\n kx4:=h*dx(x+kx3, y+ky3):\n ky4:=h*dy(x+kx3,y+ky3):\n x:=x+(kx1+2*(kx2+kx3)+kx4)/6:\n \+ y:=y+(ky1+2*(ky2+ky3)+ky4)/6:\nod:\nprint(x,y);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 8 "Not bad!" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "restart:l:=t->l0+l1*cos(w*t-phi);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "dl:=t->l1*(-sin(w*t-phi)*w);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 122 "eq:=(l0+l1*cos(w*t-phi))*di ff(theta(t),t,t)+ 2*(l0+l1*cos(w*t-phi))*l1*(-sin(w*t-phi)*w)*diff(the ta(t),t)+g*l(t)*theta(t);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 42 "init:=theta(0)=theta0, D(theta)(0)=theta1;" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 41 "pend:=dsolve(\{eq,init\},theta(t),numeric);" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "39 0 0" 0 } {VIEWOPTS 1 1 0 2 1 1805 }