{VERSION 5 0 "SGI MIPS UNIX" "5.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }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 }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 1 }0 0 0 -1 8 2 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 4 "" 0 "" {TEXT -1 61 "Using dsolve for solving s econd order differential equations." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 31 "Michael Monagan, November 2005." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "de1 := diff(y(t),t,t) = omega^2*y(t);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "de2 := diff(y(t),t,t) = -omega^2*y( t);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "dsolve( de1, y(t) ); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "dsolve( de2, y(t) );" } }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 74 "To specify the initial velocity \+ y '(0) = y0, use D(y)(0) = y0 in Maple." }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 41 "dsolve( \{de1,y(0)=y0,D(y)(0)=v0\}, y(t) );" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "dsolve( \{de2,y(0)=y0,D(y)(0 )=v0\}, y(t) );" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 151 "Damped Harmon ic Osclillator \nx(t) is the position of the body\n m is the mass of the body\n k is the spring constant\n c is the damping coefficien t." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "de := m*diff(x(t),t,t ) = -k*x(t)-c*diff(x(t),t); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "dsolve( de, x(t) );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "m := 2; k := 1/2; x0 := 1; v0 := 0; " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 57 "c := 0; \nsol0 := dsolve( \{de,x(0)=x0,D(x)(0)=v0\}, \+ x(t) );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "c_critical := sq rt(4*m*k);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 56 "c := 1;\nsol1 := dsolve( \{de,x(0)=x0,D(x)(0)=v0\}, x(t) );" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 56 "c := 3;\nsol2 := dsolve( \{de,x(0)=x0,D(x)(0)= v0\}, x(t) );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 64 "plot( \{rh s(sol1), rhs(sol2), rhs(sol0)\}, t=0..30, thickness=2 );" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 58 "Using the characteristic equation to solv e the de with c=3" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "c := 3 ; de;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "ce := 2*lambda^2+3 *lambda+1/2;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "lambda := s olve( ce, lambda );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 50 "gens ol := c1*exp(lambda[1]*t)+c2*exp(lambda[2]*t);" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 26 "e1 := x0=eval(gensol,t=0);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "e2 := v0=eval(diff(gensol,t),t=0);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "solve( \{e1,e2\}, \{c1,c2\} \+ );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "parsol := eval( genso l, solve(\{e1,e2\},\{c1,c2\}) );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "simplify( eval( lhs(de)-rhs(de), x(t)=parsol ) );" }} }{EXCHG {PARA 0 "" 0 "" {TEXT -1 51 "Generating an animation on the da mping constant c ." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 189 "for \+ i from 0 to 20 do\n c := i/3;\n sol := dsolve( \{de,x(0)=x0,D(x) (0)=v0\}, x(t) );\n F[i] := plot( rhs(sol), t=0..30 );\nod:\nplots[ display]( [seq( F[i], i=0..20 )], insequence=true );" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 44 "Using dsolve to compute numerical solutions." } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 64 "c := 1;\nsol := dsolve( \{ de,x(0)=x0,D(x)(0)=v0\}, x(t), numeric );" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 7 "sol(1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "plots[odeplot](sol,[t,x(t)],0..30,thickness=2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 55 "plots[odeplot](sol,[t,diff(x(t),t)],0..30 ,thickness=2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}} {MARK "36" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }