{VERSION 5 0 "IBM INTEL NT" "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 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "Hyperlink" -1 17 "" 0 1 0 128 128 1 2 0 1 0 0 0 0 0 0 1 }{CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "2D Input" 2 19 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 256 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 257 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 260 "" 0 1 0 255 0 1 0 0 0 0 0 0 0 0 0 0 }{PSTYLE "Norm al" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 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 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 0 -1 8 2 0 0 0 0 0 0 -1 0 }{PSTYLE "List Item" 0 14 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 3 3 0 20 0 0 0 0 14 5 }{PSTYLE "Bullet Item" 0 15 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 3 3 0 0 0 0 0 0 15 2 }{PSTYLE "L ist Subitem" 14 256 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 3 12 0 0 0 0 273 0 }{PSTYLE "" 0 257 1 {CSTYLE "" -1 -1 "" 0 1 0 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 "" 0 258 1 {CSTYLE "" -1 -1 "" 0 1 0 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 "" 0 259 1 {CSTYLE " " -1 -1 "" 0 1 0 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 "" 0 260 1 {CSTYLE "" -1 -1 "" 0 1 0 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 "" 0 261 1 {CSTYLE "" -1 -1 "" 0 1 0 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 "" 0 262 1 {CSTYLE "" -1 -1 "" 0 1 0 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 "" 0 263 1 {CSTYLE "" -1 -1 "" 0 1 0 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 "" 0 264 1 {CSTYLE "" -1 -1 "" 0 1 0 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 "" 0 265 1 {CSTYLE "" -1 -1 "" 0 1 0 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 "" 0 266 1 {CSTYLE "" -1 -1 "" 0 1 0 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 " " 0 267 1 {CSTYLE "" -1 -1 "" 0 1 0 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 "" 0 268 1 {CSTYLE "" -1 -1 "" 0 1 0 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 "" 0 269 1 {CSTYLE "" -1 -1 "" 0 1 0 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 "" 0 270 1 {CSTYLE "" -1 -1 "" 0 1 0 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 "" 0 271 1 {CSTYLE "" -1 -1 "" 0 1 0 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 "" 0 272 1 {CSTYLE "" -1 -1 "" 0 1 0 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 "" 0 273 1 {CSTYLE "" -1 -1 "" 0 1 0 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 "" 0 274 1 {CSTYLE "" -1 -1 "" 0 1 0 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 "" 0 275 1 {CSTYLE "" -1 -1 "" 0 1 0 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 "" 0 276 1 {CSTYLE "" -1 -1 "" 0 1 0 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 "" 0 277 1 {CSTYLE "" -1 -1 "" 0 1 0 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 }} {SECT 0 {EXCHG {PARA 269 "" 0 "" {TEXT -1 0 "" }}{PARA 257 "" 0 "" {TEXT -1 32 "DIFFERENTIAL EQUATIONS POWERTOOL" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 270 "" 0 "" {TEXT -1 57 "Unit 1 -- Introduction \+ to Differential Equations in Maple" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 265 "" 0 "" {URLLINK 17 "Prof. Douglas B. Meade" 4 "http://www.m ath.sc.edu/~meade/" "" }}{PARA 258 "" 0 "" {URLLINK 17 "Industrial Mat hematics Institute" 4 "http://www.math.sc.edu/~IMI/" "" }}{PARA 259 " " 0 "" {URLLINK 17 "Department of Mathematics" 4 "http://www.math.sc.e du/" "" }}{PARA 260 "" 0 "" {URLLINK 17 "University of South Carolina " 4 "http://www.sc.edu/" "" }}{PARA 261 "" 0 "" {TEXT -1 19 "Columbia, SC 29208\n" }}{PARA 263 "" 0 "" {TEXT -1 7 "URL: " }{URLLINK 17 "ht tp://www.math.sc.edu/~meade/" 4 "http://www.math.sc.edu/~meade/" "" }} {PARA 264 "" 0 "" {TEXT -1 25 "E-mail: meade@math.sc.edu" }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 262 "" 0 "" {TEXT -1 38 "Copyright \251 \+ 2001 by Douglas B. Meade" }}{PARA 266 "" 0 "" {TEXT -1 19 "All rights reserved" }}{PARA 268 "" 0 "" {TEXT -1 0 "" }}{PARA 267 "" 0 "" {TEXT -1 67 "--------------------------------------------------------- ----------" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 0 "" }}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 18 "Outline fo r Unit 1" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 14 "" 0 "" {HYPERLNK 17 "1.A" 1 "" "1.A" }{TEXT -1 45 " Entering differential equations in Maple" }}{PARA 256 "" 0 "" {HYPERLNK 17 "1.A-1" 1 "" "1. A-1" }{TEXT -1 38 " First-order differential equations" }}{PARA 256 "" 0 "" {HYPERLNK 17 "1.A-2" 1 "" "1.A-2" }{TEXT -1 39 " Higher -order differential equations" }}{PARA 256 "" 0 "" {HYPERLNK 17 "1.A-3 " 1 "" "1.A-3" }{TEXT -1 37 " Systems of differential equations" }} {PARA 14 "" 0 "" {HYPERLNK 17 "1.B" 1 "" "1.B" }{TEXT -1 49 " Expl icit solutions to differential equations" }}{PARA 256 "" 0 "" {HYPERLNK 17 "1.B-1" 1 "" "1.B-1" }{TEXT -1 21 " General solutions " }}{PARA 256 "" 0 "" {HYPERLNK 17 "1.B-2" 1 "" "1.B-2" }{TEXT -1 46 " Solutions to initial value problems (IVPs)" }}{PARA 14 "" 0 "" {HYPERLNK 17 "1.C" 1 "" "1.C" }{TEXT -1 33 " Numerical Solution to an IVP" }}{PARA 14 "" 0 "" {HYPERLNK 17 "1.D" 1 "" "1.D" }{TEXT -1 33 " Graphical Solution to an IVP" }}{PARA 14 "" 0 "" {HYPERLNK 17 "1.E" 1 "" "1.E" }{TEXT -1 11 " Using " }{HYPERLNK 17 "odeadvis or" 2 "odeadvisor" "" }{TEXT -1 19 " to classify an ODE" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 14 "Initialization" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "rest art;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "with( DEtools ):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "with( plots ):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "with( linalg ):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 0 {PARA 3 "" 0 "1.A" {TEXT -1 44 "1.A Ente ring differential equations in Maple" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 130 "A differential equation can be entered in Maple using any of t he methods for constructing algebraic, transcendental, or any other " }{HYPERLNK 17 "equation" 2 "equation" "" }{TEXT -1 153 " in Maple. It \+ is a good idea to assign each differential equation to a unique, and d escriptive, Maple name. Such assignments are typically done using an \+ " }{HYPERLNK 17 "assignment statement" 2 "assignment" "" }{TEXT -1 1 " ." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "ode := diff( x(t), t ) = k * x(t);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 4 "Th e " }{HYPERLNK 17 "assign" 2 "assign" "" }{TEXT -1 86 " command will n ot be of too much use in creating differential equations. Note that if " }{HYPERLNK 17 "assign" 2 "assign" "" }{TEXT -1 109 " is used to con vert an equality into an assignment, the result of the assignment will not have an equal sign," }{TEXT 256 5 " i.e." }{TEXT -1 20 ", it will not be an " }{HYPERLNK 17 "equation" 2 "equation" "" }{TEXT -1 235 ". When Maple expects an equation and receives an expression, the expres sion is assumed to be the left-hand side of an equation whose right-ha nd side is zero. For example, when working with Newton's second law of motion, one might have:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "eq_of_motion := F = m*a;" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 56 "eq_of_motion2 := eval( eq_of _motion, a=diff(x(t),t,t) );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 9 "When the " }{HYPERLNK 17 "assign" 2 "assign" "" }{TEXT -1 23 " command is applied to " }{TEXT 19 13 "eq_of_motion2" }{TEXT -1 1 "," }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "assign(eq_of_motion2);" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 34 "the result is that the Maple name " }{TEXT 19 1 "F" } {TEXT -1 27 " has been assigned a value," }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "F;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 10 "N ote that " }{TEXT 19 1 "F" }{TEXT -1 277 " is only an expression, not \+ an equation. In most instances, when Maple receives an expression when an equation is expected, it is assumed that the expression is the lef t-hand side of the equation and the right-hand side is zero. Thus, the following two commands are equivalent:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "dsolve( F, x(t) );" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "dsolve( F=0, x(t) );" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{SECT 0 {PARA 4 "" 0 "1. A-1" {TEXT -1 40 "1.A-1 First-order differential equations" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 130 "A first-order differential equation is a n equation that expresses a relationship between a function, x, its in dependent variable, " }{XPPEDIT 18 0 "t" "6#%\"tG" }{TEXT -1 22 ", and the derivative, " }{XPPEDIT 18 0 "diff(x(t),t)" "6#-%%diffG6$-%\"xG6# %\"tGF)" }{TEXT -1 183 ". (Note that Maple expresses all derivatives a s partial derivatives. This is a fact of life that we must accept.) Ot her numeric or symbolic parameters can appear in the equation. The " } {HYPERLNK 17 "diff" 2 "diff" "" }{TEXT -1 5 " and " }{HYPERLNK 17 "D" 2 "D" "" }{TEXT -1 53 " commands are used to represent derivatives in \+ Maple." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "q1 := `x'` = diff (x(t), t ):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "q1;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "conv ert( q1, D );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 60 "The general form for a first-order differential equation is " }{XPPEDIT 18 0 "F(t,x(t),diff(x(t),t))=0" "6#/-%\"FG6%%\"tG-%\"xG6#F'-%%diffG6$-F)6#F'F'\"\"!" }{TEXT -1 65 ". I n most cases it will be possible to solve for the derivative, " } {TEXT 257 4 "i.e," }{TEXT -1 1 " " }{XPPEDIT 18 0 "diff(x(t),t) = G(t, x(t))" "6#/-%%diffG6$-%\"xG6#%\"tGF*-%\"GG6$F*-F(6#F*" }{TEXT -1 9 ". \+ While " }{HYPERLNK 17 "dsolve" 2 "dsolve" "" }{TEXT -1 78 " can gener ally work with ODEs specified in either form, the graphical command " }{HYPERLNK 17 "DEplot" 2 "DEplot" "" }{TEXT -1 63 " requires the expli cit format (or its equivalent for a system)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 0 {PARA 4 "" 0 "1.A-2" {TEXT -1 41 "1.A-2 Higher-order differential equa tions" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 63 "A second-order derivative of a function x can be entered using " }{HYPERLNK 17 "diff" 2 "diff" "" }{TEXT -1 3 " as" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "q2 := `x''` = diff( x(t), t,t ):" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "q2;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 51 "The correspon ding derivative expressed in terms of " }{HYPERLNK 17 "D" 2 "D" "" } {TEXT -1 3 " is" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 17 "convert( q2, D );" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 93 "If the righ t-hand side of this expression were entered explicitly, the syntax wou ld be one of" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "(D@D)(x)(t);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 2 "or" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "(D@ @2)(x)(t);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 50 "The second form is functionally equivalen t to the " }{HYPERLNK 17 "composition" 2 "@" "" }{TEXT -1 27 " of D wi th itself, that is," }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "D( D(x) )(t);" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 99 "To represen t higher-order derivatives, it is sometimes more convenient to use the dollar operator, " }{HYPERLNK 17 "$" 2 "dollar" "" }{TEXT -1 64 ", in stead of explicitly listing the independent variable in the " } {HYPERLNK 17 "diff" 2 "diff" "" }{TEXT -1 34 " command once for each d erivative." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 28 "`x'''` := diff( x(t), t$3 );" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 43 "The eq uivalent expressions in terms of the " }{HYPERLNK 17 "D" 2 "D" "" } {TEXT -1 12 " command are" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "(D@D@D)(x)(t);" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 13 "(D@@3)(x)(t);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 0 {PARA 4 "" 0 "1.A-3" {TEXT -1 39 "1.A-3 \+ Systems of differential equations" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 33 "The general form for a system of " }{XPPEDIT 18 0 "m" "6#%\"mG" } {TEXT -1 44 " first-order differential equations for the " }{XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT -1 11 " functions " }{XPPEDIT 18 0 "x[1]" "6 #&%\"xG6#\"\"\"" }{TEXT -1 2 ", " }{XPPEDIT 18 0 "x[2]" "6#&%\"xG6#\" \"#" }{TEXT -1 7 ", ..., " }{XPPEDIT 18 0 "x[n]" "6#&%\"xG6#%\"nG" } {TEXT -1 27 " with independent variable " }{XPPEDIT 18 0 "t" "6#%\"tG " }{TEXT -1 3 " is" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 271 "" 0 " " {XPPEDIT 18 0 "F[1]" "6#&%\"FG6#\"\"\"" }{TEXT -1 1 "(" }{XPPEDIT 18 0 "t" "6#%\"tG" }{TEXT -1 2 ", " }{XPPEDIT 18 0 "x[1](t)" "6#-&%\"x G6#\"\"\"6#%\"tG" }{TEXT -1 2 ", " }{XPPEDIT 18 0 "x[2](t)" "6#-&%\"xG 6#\"\"#6#%\"tG" }{TEXT -1 6 ",..., " }{XPPEDIT 18 0 "x[n](t)" "6#-&%\" xG6#%\"nG6#%\"tG" }{TEXT -1 2 ", " }{XPPEDIT 18 0 "diff(x[1](t),t)" "6 #-%%diffG6$-&%\"xG6#\"\"\"6#%\"tGF," }{TEXT -1 2 ", " }{XPPEDIT 18 0 " diff(x[2](t),t)" "6#-%%diffG6$-&%\"xG6#\"\"#6#%\"tGF," }{TEXT -1 7 ", \+ ..., " }{XPPEDIT 18 0 "diff(x[n](t),t)" "6#-%%diffG6$-&%\"xG6#%\"nG6#% \"tGF," }{TEXT -1 6 " ) = 0" }}{PARA 272 "" 0 "" {XPPEDIT 18 0 "F[2]" "6#&%\"FG6#\"\"#" }{TEXT -1 1 "(" }{XPPEDIT 18 0 "t" "6#%\"tG" }{TEXT -1 2 ", " }{XPPEDIT 18 0 "x[1](t)" "6#-&%\"xG6#\"\"\"6#%\"tG" }{TEXT -1 2 ", " }{XPPEDIT 18 0 "x[2](t)" "6#-&%\"xG6#\"\"#6#%\"tG" }{TEXT -1 6 ",..., " }{XPPEDIT 18 0 "x[n](t)" "6#-&%\"xG6#%\"nG6#%\"tG" } {TEXT -1 2 ", " }{XPPEDIT 18 0 "diff(x[1](t),t)" "6#-%%diffG6$-&%\"xG6 #\"\"\"6#%\"tGF," }{TEXT -1 2 ", " }{XPPEDIT 18 0 "diff(x[2](t),t)" "6 #-%%diffG6$-&%\"xG6#\"\"#6#%\"tGF," }{TEXT -1 7 ", ..., " }{XPPEDIT 18 0 "diff(x[n](t),t)" "6#-%%diffG6$-&%\"xG6#%\"nG6#%\"tGF," }{TEXT -1 6 " ) = 0" }}{PARA 273 "" 0 "" {TEXT -1 1 "." }}{PARA 276 "" 0 "" {TEXT -1 1 "." }}{PARA 275 "" 0 "" {TEXT -1 1 "." }}{PARA 274 "" 0 "" {XPPEDIT 18 0 "F[m]" "6#&%\"FG6#%\"mG" }{TEXT -1 1 "(" }{XPPEDIT 18 0 "t" "6#%\"tG" }{TEXT -1 2 ", " }{XPPEDIT 18 0 "x[1](t)" "6#-&%\"xG6#\" \"\"6#%\"tG" }{TEXT -1 2 ", " }{XPPEDIT 18 0 "x[2](t)" "6#-&%\"xG6#\" \"#6#%\"tG" }{TEXT -1 6 ",..., " }{XPPEDIT 18 0 "x[n](t)" "6#-&%\"xG6# %\"nG6#%\"tG" }{TEXT -1 2 ", " }{XPPEDIT 18 0 "diff(x[1](t),t)" "6#-%% diffG6$-&%\"xG6#\"\"\"6#%\"tGF," }{TEXT -1 2 ", " }{XPPEDIT 18 0 "diff (x[2](t),t)" "6#-%%diffG6$-&%\"xG6#\"\"#6#%\"tGF," }{TEXT -1 7 ", ..., " }{XPPEDIT 18 0 "diff(x[n](t),t)" "6#-%%diffG6$-&%\"xG6#%\"nG6#%\"tG F," }{TEXT -1 7 " ) = 0." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT -1 83 "In most cases of interest, it will be possible to \+ explicitly solve for each of the " }{XPPEDIT 18 0 "n" "6#%\"nG" } {TEXT -1 31 " first derivatives in terms of " }{XPPEDIT 18 0 "t" "6#% \"tG" }{TEXT -1 9 " and the " }{XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT -1 26 " function values. That is," }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 277 "" 0 "" {TEXT -1 1 " " }{XPPEDIT 18 0 "diff( x[i](t), t )" " 6#-%%diffG6$-&%\"xG6#%\"iG6#%\"tGF," }{TEXT -1 3 " = " }{XPPEDIT 18 0 "G[i]" "6#&%\"GG6#%\"iG" }{TEXT -1 1 "(" }{XPPEDIT 18 0 "t" "6#%\"tG" }{TEXT -1 2 ", " }{XPPEDIT 18 0 "x[1](t)" "6#-&%\"xG6#\"\"\"6#%\"tG" } {TEXT -1 2 ", " }{XPPEDIT 18 0 "x[2](t)" "6#-&%\"xG6#\"\"#6#%\"tG" } {TEXT -1 7 ", ..., " }{XPPEDIT 18 0 "x[n](t)" "6#-&%\"xG6#%\"nG6#%\"tG " }{TEXT -1 8 " ) for " }{XPPEDIT 18 0 "i" "6#%\"iG" }{TEXT -1 14 " = 1, 2, ..., " }{XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT -1 1 "." }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 165 "While it is possi ble to express a system of differential equations in terms of Maple ve ctors, it is generally preferable to express the system as a list (or \+ set) of " }{XPPEDIT 18 0 "m" "6#%\"mG" }{TEXT -1 63 " equations. For e xample, the second-order differential equation" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "ode2 := dif f( x(t), t,t ) + sin( x(t) ) = 0;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 43 "can be repres ented as a system in terms of " }{XPPEDIT 18 0 "x(t)" "6#-%\"xG6#%\"tG " }{TEXT -1 5 " and " }{XPPEDIT 18 0 "v(t)=diff(x(t),t)" "6#/-%\"vG6#% \"tG-%%diffG6$-%\"xG6#F'F'" }{TEXT -1 1 " " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "sys := [ diff( x( t), t ) = v(t)," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " diff( v (t), t ) = -sin(x(t)) ];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 " " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 111 "For a linear system, the set of explicit differential equations can be constructed from the coeffi cient matrix." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "A := matrix( 2, 2, [[a,b],[c,d]] );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "X := vector( 2, [x[1](t), x[2](t)] \+ );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "`X'` := map( diff, X, t );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "sys1 := geneqns( A , X, `X'`);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "sys2 := map( isolate, sys1, diff );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 " " }}}}}{SECT 0 {PARA 3 "" 0 "1.B" {TEXT -1 48 "1.B Explicit solutions \+ to differential equations" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 4 "The " }{HYPERLNK 17 "dsolve" 2 "dsolve" "" }{TEXT -1 290 " command is used t o obtain a solution to a differential equation. If initial and/or boun dary conditions are specified, Maple attempts to find a particular sol ution to the specified initial or boundary value problem. Otherwise, t he result is a general solution to the differential equation. " }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{SECT 0 {PARA 4 "" 0 "1. B-1" {TEXT -1 23 "1.B-1 General solutions" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 100 "The simplest form of the dsolve command requires the dif ferential equation and the unknown function:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "ode := diff( x(t) , t ) = k*x(t);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "fn := x (t);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "sol := dsolve( ode, fn );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 117 "The methods considered and executed by Maple t o obtain a solution to an ODE or IVP can be observed by increasing the " }{HYPERLNK 17 "infolevel" 2 "infolevel" "" }{TEXT -1 5 " for " } {HYPERLNK 17 "dsolve" 2 "dsolve" "" }{TEXT -1 7 " to 3 :" }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "info level[dsolve] := 3:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 48 "Then, re-executing the previous ex ample yields :" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 18 "dsolve( ode, fn );" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 50 "To suppress the additional information, reset the " }{HYPERLNK 17 "infolevel" 2 " infolevel" "" }{TEXT -1 5 " for " }{HYPERLNK 17 "dsolve" 2 "dsolve" " " }{TEXT -1 7 " to 0 :" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "infolevel[dsolve] := 0:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 6 "Notes:" }}{PARA 15 "" 0 "" {TEXT -1 85 "all occurrences of the u nknown function in the ODE include the independent variable, " } {XPPEDIT 18 0 "x(t)" "6#-%\"xG6#%\"tG" }{TEXT -1 30 ", not just the fu nction name, " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 1 ";" }}{PARA 15 "" 0 "" {TEXT -1 158 "since this is a general solution to a first-o rder equation, the general solution is a one parameter family of solut ions, the default name of the parameter is " }{TEXT 19 3 "_C1" }{TEXT -1 1 ";" }}{PARA 15 "" 0 "" {TEXT -1 14 "the result of " }{HYPERLNK 17 "dsolve" 2 "dsolve" "" }{TEXT -1 70 " is an equation, to access the right-hand side of this definition use " }{HYPERLNK 17 "rhs" 2 "rhs" "" }{TEXT -1 1 ":" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "X := r hs(sol);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 15 "" 0 "" {TEXT -1 13 "applying the " }{HYPERLNK 17 "assign" 2 "assign" "" }{TEXT -1 26 " command to the result of " }{HYPERLNK 17 "d solve" 2 "dsolve" "" }{TEXT -1 6 " does " }{TEXT 258 3 "not" }{TEXT -1 141 " convert the solution to a Maple function of the independent v ariable, to obtain the solution as a function of the independent varia ble, use " }{HYPERLNK 17 "unapply" 2 "unapply" "" }{TEXT -1 1 ":" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "X := unapply( rhs(sol), t ); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "X(0);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 78 "T he syntax for obtaining the general solution for a system of ODEs is s imilar:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "sys := diff( x(t), t ) = v(t)," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " diff( v(t), t ) = 2*x(t) - v(t);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "fns := x(t), v(t);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "sol := dsolve( \{sys\}, \{fn s\} );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 6 "Notes:" }}{PARA 15 "" 0 "" {TEXT -1 155 "the fir st argument to dsolve must be either a single ODE or a set or list of \+ ODEs; the second argument, the dependent function(s), follows a simila r format" }}{PARA 15 "" 0 "" {TEXT -1 31 "because the result returned \+ by " }{HYPERLNK 17 "dsolve" 2 "dsolve" "" }{TEXT -1 28 " is a set of e quations, use " }{HYPERLNK 17 "subs" 2 "subs" "" }{TEXT -1 4 " or " } {HYPERLNK 17 "eval" 2 "eval" "" }{TEXT -1 98 " to extract the individu al components of the solution (this approach can also be used in place of " }{HYPERLNK 17 "rhs" 2 "rhs" "" }{TEXT -1 22 " for single equatio ns)" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "X := subs( sol, x(t) );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "V := eval( v(t), sol );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 0 {PARA 4 "" 0 "1.B-2" {TEXT -1 48 "1.B-2 Solutions to initial value problems \+ (IVPs)" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 217 "An initial value proble m is an ODE together with an appropriate set of initial conditions. To find the solution of an IVP with dsolve, the first argument must be a set consisting of the ODE and the initial conditions:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "ode;" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "ic := x(0)=A;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "dsolve( \{ode,ic\}, fn );" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 72 "An IVP for a system of ODEs requires one initial conditio n for each ODE." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 4 "sys;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "sys_ic := x(0)=X0, v(0)=0;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "sys_soln := dsolve( \{sys, sys_ic\}, \{fns\} );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 259 "For an IVP for an ODE of order n requires n initial conditions , i.e., values for the unknown function and its first (n-1) derivative s at a single point. The following example is the second-order IVP is \+ equivalent to the the first-order system just considered." }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 57 "ode2 := diff( x(t), t,t ) + diff( x(t), t ) - 2*x(t) = 0;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "ic2 := x(0)=X0, D(x)(0)=0;" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "sol2 := dsolve( \{ode2,ic2\} , x(t) );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 4 "The " }{HYPERLNK 17 "odetest" 2 "odetest" "" }{TEXT -1 139 " command can be used to verify the equivalence of th e second-order ODE and the system of first-order ODEs. First, verify t hat the function " }{XPPEDIT 18 0 "x(t)" "6#-%\"xG6#%\"tG" }{TEXT -1 43 " returned as part of the system's solution," }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "sys_solnX : = op(select(has,sys_soln,x(t)));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 30 "satisfies the second-order ODE" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 27 "odetest( sys_solnX, ode2 );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 28 "Alternatively, the function " }{XPPEDIT 18 0 "v(t)" "6#-%\"vG6# %\"tG" }{TEXT -1 48 " satisfying the system of ODEs is computed to be " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "sol2v := v(t) = diff(rhs(sol2),t);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 33 "a nd the check that the functions " }{XPPEDIT 18 0 "x(t)" "6#-%\"xG6#%\" tG" }{TEXT -1 2 ", " }{XPPEDIT 18 0 "v(t)" "6#-%\"vG6#%\"tG" }{TEXT -1 57 " satisfy the system of ODEs is completed with the command" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "odetest( \{sol2,sol2v\}, \{sys\} );" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 18 "Note that M aple's " }{HYPERLNK 17 "dsolve" 2 "dsolve" "" }{TEXT -1 136 " command \+ is not savvy enough to know what to do with a differential equation th at does not explicitly identify the independent variable:" }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "dsol ve( D(x)=k*x, x(t) );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "ds olve( D(x)(t)=k*x(t), x(t) );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "convert(D(x)(0)=2, diff);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 62 "This is just one of man y reasons why most users prefer to use " }{HYPERLNK 17 "diff" 2 "diff " "" }{TEXT -1 39 " when creating a differential equation." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "dso lve( D(x)=k*x, x(t) );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 4 "The " }{HYPERLNK 17 "D" 2 "D" " " }{TEXT -1 98 " operator is generally used to specify derivative init ial and/or boundary conditions. For example," }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "dsolve( \{diff(x( t),t)=k*x(t), D(x)(0)=1\}, x(t) );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 93 "While the der ivative condition can be converted to an equivalent expression in term s of diff," }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 24 "convert(D(x)(0)=1,diff);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 70 "it is not \+ practical to use this expression as an initial condition in " } {HYPERLNK 17 "dsolve" 2 "dsolve" "" }{TEXT -1 1 ":" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 63 "dsolve( \{d iff(x(t),t)=k*x(t), convert(D(x)(0),diff)=1\}, x(t) );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}}{SECT 0 {PARA 3 "" 0 "1.C" {TEXT -1 33 "1.C Numerical solutions to an IVP" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 271 "It is not possible to find an explicit solution for m any IVPs. And, even when it is possible to find an explicit solution, \+ the solution might be so complicated to be of little or no practical u se. When such situations are encountered, Maple can be instructed to r eturn a " }{HYPERLNK 17 "numerical solution" 2 "dsolve,numeric" "" } {TEXT -1 25 " to the IVP by including " }{HYPERLNK 17 "type=numeric" 2 "dsolve,numeric" "" }{TEXT -1 28 " as an optional argument to " } {HYPERLNK 17 "dsolve" 2 "dsolve" "" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 108 "Note that values must be assigned to all parameters in the IVP before asking Maple for a numer ical solution." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 5 "ode2;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "ic3 := eval(ic2,X0=3);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "nsol := dsolve( \{ode2,ic3\}, x(t), type=numeric );" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 338 "The p rocedure requires a value of the independent variable as its argument. The valued returned by this procedure is a list of equations. The fir st equation specifies the value of the independent variable, subsequen t equations display the value of each of the functions (including deri vatives) for which an initial condition is specified." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "nsol(1); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 4 "The " }{HYPERLNK 17 "odeplot" 2 "plots,odeplot" "" } {TEXT -1 23 " command, found in the " }{HYPERLNK 17 "plots" 2 "plots" "" }{TEXT -1 150 " package, can be used to produce one or more plots o f the numeric solution to an IVP. In the first example, the graphs of \+ the (approximate) solution (" }{TEXT 259 3 "red" }{TEXT -1 28 ") and i ts first derivative (" }{TEXT 260 5 "green" }{TEXT -1 38 ") are displa yed on the interval [0,1]:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 76 "odeplot( nsol, [[t,x(t)],[t,diff(x( t),t)]], 0..1, legend=[`x(t)`,`x'(t)`] );" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 22 "A powerful \+ feature of " }{HYPERLNK 17 "odeplot" 2 "plots,odeplot" "" }{TEXT -1 89 " is the ability to plot expressions involving the solution of the \+ IVP. Here, the plot of " }{XPPEDIT 18 0 "x(t) - diff(x(t),t)" "6#,&-% \"xG6#%\"tG\"\"\"-%%diffG6$-F%6#F'F'!\"\"" }{TEXT -1 41 " on [0,10] pr ovides strong evidence that " }{XPPEDIT 18 0 "limit( x(t)-diff(x(t),t) , t=infinity ) = 0" "6#/-%&limitG6$,&-%\"xG6#%\"tG\"\"\"-%%diffG6$-F)6 #F+F+!\"\"/F+%)infinityG\"\"!" }{TEXT -1 1 ":" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "odeplot( ns ol, [t,x(t)-diff(x(t),t)], 0..10 );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 91 "The default n umerical integration algorithm is a Fehlberg fourth-fifth Runge-Kutta \+ method (" }{HYPERLNK 17 "RKF45" 2 "dsolve,rkf45" "" }{TEXT -1 66 "). B oth higher-order and classical methods are specified with the " } {HYPERLNK 17 "method=" 2 "dsolve,numeric" "" }{TEXT -1 94 " optional a rgument. For example, the approximate solution using Euler's method, w ith stepsize " }{XPPEDIT 18 0 "h=0.1" "6#/%\"hG-%&FloatG6$\"\"\"!\"\" " }{TEXT -1 18 ", is obtained with" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 83 "Xeuler := dsolve( \{ode2,ic 3\}, x(t), type=numeric, method=classical, stepsize=0.1 );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 94 "A plot comparing the RKF45 and Euler's method solutions on the \+ interval [0,2] is obtained with" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "p1 := odeplot( nsol, [t,x(t) ], 0..2, color=red ):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "p2 := odep lot( Xeuler, [t,x(t)], 0..2, color=blue ):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "display( [p1,p2] );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 219 "The dsolve c ommand can also create a table of values for the solution of an IVP us ing any of the available methods. For example, the table of values of \+ the solution (and its derivative) using the forward Euler method at" } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "times := array( [i/10$i=0..10, $2..10] );" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 27 "is cre ated with the command" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 112 "t1 := dsolve( \{ode2,ic3\}, x(t), \+ type=numeric, method=classical[foreuler], value=array([i/10$i=0..10, $ 2..10]) );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 156 "Note that this structure is a 2 x 1 matr ix in which the (2,1) entry is itself a matrix. Thus, for example, the approximate value of the solution at t=0.5 is" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "t1[2,1][6,2 ];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 264 "A more interesting use of a table of values is to compare the solutions for two different numerical methods (or for one method with different stepsize). To illustrate, the table computed us ing the Adams-Bashforth-Moulton predictor-corrector method is computed with" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 113 "t2 := dsolve( \{ode2,ic3\}, x(t), type=numeric, meth od=classical[abmoulton], value=array([i/10$i=0..10, $2..10]) ):" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 162 "The column corresponding to the solution, x(t), from the predictor-corrector method can be compared to the corresponding colum n for the forward Euler method using" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 67 "header1 := vector([` t `, `Forward Euler`, `Predictor-Corrector`]):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 67 "header2 := vector([`---`, `-------------`, `--------- ----------`]):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 77 "stackmatrix( head er1, header2, augment( col(t1[2,1],1..2), col(t2[2,1],2) ));" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 0 {PARA 3 "" 0 "1 .D" {TEXT -1 33 "1.D Graphical solutions to an IVP" }}{EXCHG {PARA 0 " " 0 "" {TEXT -1 65 "One of the graphical tools for analyzing the solut ion of an IVP, " }{HYPERLNK 17 "odeplot" 2 "plots,odeplot" "" }{TEXT -1 19 ", was discussed in " }{HYPERLNK 17 "Section 1.C" 2 "" "1.C" } {TEXT -1 6 ". The " }{HYPERLNK 17 "DEplot" 2 "DEtools,DEplot" "" } {TEXT -1 19 " command, from the " }{HYPERLNK 17 "DEtools" 2 "DEtools" "" }{TEXT -1 108 " package, provides graphical information directly fr om the differential equation(s). In it's simplest form, " }{HYPERLNK 17 "DEplot" 2 "DEtools,DEplot" "" }{TEXT -1 45 " can create a plot of \+ the solution to an IVP:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "ode2;ic3;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "DEplot( ode2, x(t), t=-1..2, [[ic3]] );" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 81 "The extra set of square brackets around the initial condi tion are needed because " }{HYPERLNK 17 "DEplot" 2 "DEtools,DEplot" " " }{TEXT -1 226 " facilitates the display of the solution to several d ifferent initial conditions in a single plot. For example, the plot of the solution for two additional sets of initial conditions can be add ed with one simple change to the " }{HYPERLNK 17 "DEplot" 2 "DEtools,D Eplot" "" }{TEXT -1 9 " command:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "ic4 := x(0)=0, D(x)(0)=3;" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "ic5 := x(0)=-3, D(x)(0)=0;" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 51 "DEplot( ode2, x(t), t=-1..2, [[ic3],[ic4],[ic5]] );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 " " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 168 "To illustrate the capabiliti es of DEplot for a system of ODEs, consider the classical Lotka-Volter ra model for a predator-prey interaction between a rabbit population, \+ " }{XPPEDIT 18 0 "r(t)" "6#-%\"rG6#%\"tG" }{TEXT -1 24 ", and a fox po pulation, " }{XPPEDIT 18 0 "f(t)" "6#-%\"fG6#%\"tG" }{TEXT -1 12 " (se e also, " }{HYPERLNK 17 "Unit 26" 1 "unit26.mws" "" }{TEXT -1 2 "):" } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "sys_PP := diff(r(t),t)=r(t)*(2-f(t))," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " diff(f(t),t)=.3*f(t)*(r(t)-1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "fns_PP := r(t), f(t);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 69 "The direction field for this system can be obtained with the co mmand:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 65 "DEplot( [sys_PP], [fns_PP], t=0..1, r=0..8, f=0..6, a rrows=SMALL," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 59 " title=`Dire ction Field for Predator-Prey System` );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 210 "Note that no initial conditions have been specified and that, because the system i s autonomous, the range for the independent variable is immaterial to \+ the appearance of the direction field (but is required by " } {HYPERLNK 17 "DEplot" 2 "DEtools,DEplot" "" }{TEXT -1 2 ")." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 85 "To create a pha se portrait from the solutions for a collection of initial conditions: " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "ic_PP := [r(0)=2.5,f(0)=i] $ i=1..5;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 59 "DEplot( [sys_PP], [fns_PP], t=0..30 , [ic_PP], arrows=SMALL," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " \+ stepsize=0.1, linecolor=BLUE," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 58 " \+ title=`Phase Portrait for Predator-Prey System` );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 142 "Solution curves for rabbit and fox populations for each of the se initial conditions can be obtained by specifying the view= optional argument:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 68 "pR := DEplot( [sys_PP], [fns_PP], t=0..30, [ic_PP[1 ]], arrows=SMALL," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 58 " \+ stepsize=0.1, linecolor=BLUE, scene=[t,r] ):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 68 "pF := DEplot( [sys_PP], [fns_PP], t=0..30, [ic_PP[1]] , arrows=SMALL," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 57 " st epsize=0.1, linecolor=RED, scene=[t,f] ):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "display( [pR,pF] );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 33 "Additional op tional arguments to " }{HYPERLNK 17 "DEplot" 2 "DEtools,DEplot" "" } {TEXT -1 114 " allow for the specification of the numeical method to b e used (the default is a fourth-order Runge-Kutta method, " } {HYPERLNK 17 "method=classical[rk4]" 2 "dsolve,classical" "" }{TEXT -1 113 "), the color and number of arrows in a direction field, and ma ny other features beyond the needs for this course." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 0 {PARA 3 "" 0 "1.E" {TEXT -1 10 "1.E Using " }{HYPERLNK 17 "odeadvisor" 2 "odeadvisor" "" }{TEXT -1 19 " to classify an ODE" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 4 "The \+ " }{HYPERLNK 17 "odeadvisor" 2 "odeadvisor" "" }{TEXT -1 22 " command, part of the " }{HYPERLNK 17 "DEtools" 2 "Detools" "" }{TEXT -1 118 " \+ package, provides a method to check the classification of an ODE prior to obtaining a solution. The basic syntax for " }{HYPERLNK 17 "odeadv isor" 2 "odeadvisor" "" }{TEXT -1 16 " is very simple." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "ode := diff( y(t), t ) = a*y(t);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "odeadvisor( ode, y(t) );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 142 "This result is a little surprising. Most users, including myself, generally classify this ODE as either separable or first-order linear. When " }{TEXT 19 10 "odead visor" }{TEXT -1 76 " returns an unexpected, or unfamiliar, response i t can be useful to include " }{TEXT 19 4 "help" }{TEXT -1 26 " as the \+ final argument to " }{TEXT 19 10 "odeadvisor" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 1 " " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 " odeadvisor( ode, y(t), help );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 122 "To check if an ODE is solvable by one or more specific methods, a list of methods can be in cluded as an optional argument." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "odeadvisor( ode, y(t), [sepa rable] );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "odeadvisor( od e, y(t), [exact] );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 112 "A (seemingly) simple modification to the ODE can significantly alter the classification of the ODE. For example," }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 40 "ode2 := diff( y(t), t ) = a*y(t) + f(t):" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "odeadvisor( ode2 );" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "odeadvisor( ode2, [separable ] );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 68 "Second-, and higher-, order ODEs can be handled i n a similar manner." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 60 "ode3 := x^2*diff(y(x),x$2) + 2*x*diff(y(x ),x) + y(x) = f(x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "odea dvisor( ode3, help );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" } }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 15 "Unfortunately, " }{TEXT 19 10 "o deadvisor" }{TEXT -1 60 " is not able to provide any assistance for a \+ system of ODEs." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 55 "sys1 := \{ diff(v(t),t) + x(t) = 0, diff(x(t), t)=v(t) \};" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "odeadvisor( \+ sys1, \{x(t),v(t)\} );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 73 "Of course, if the system is con verted to an equivalent higher-order ODE, " }{TEXT 19 10 "odeadvisor" }{TEXT -1 50 " might be able to provide some useful information." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "ode4 := diff(x(t),t$2) + x(t) = 0;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "odeadvisor( ode4 );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 29 "It is not a s urprise to have " }{TEXT 19 10 "odeadvisor" }{TEXT -1 116 " return res ults that are beyond the scope of a first course, or any undergraduate course, in differential equations." }}{PARA 0 "" 0 "" {TEXT -1 0 "" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "ode5 := (2*y(x)-x)*diff(y( x),x)-y(x)-2*x;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "odeadvis or( ode5 );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 320 "This means that we will expect Maple to \+ be able to solve many ODEs and IVPs that we won't be able to solve by \+ hand at the end of this course. It also means that when we can solve a n equation by hand, our results may appear different from Maple's beca use of the different methods used to obtain the solution. Recall that \+ " }{HYPERLNK 17 "infolevel[dsolve]:=3:" 2 "infolevel" "" }{TEXT -1 67 " causes Maple to display information about the methods used by the " }{HYPERLNK 17 "dsolve" 2 "dsolve" "" }{TEXT -1 10 " command; " } {HYPERLNK 17 "infolevel[dsolve]:=0:" 2 "infolevel" "" }{TEXT -1 26 " t urns off these messages." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 9 "[Back to " }{HYPERLNK 17 "ODE Powertool Table of Contents" 1 "un it00.mws" "" }{TEXT -1 1 "]" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "0 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 } {PAGENUMBERS 0 1 2 33 1 1 }