{VERSION 5 0 "IBM INTEL LINUX" "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 Comment" -1 18 "Times" 0 1 0 0 0 0 0 0 2 2 2 2 0 0 0 1 }{CSTYLE "_cstyle24" -1 213 "Times" 0 1 0 0 0 0 0 0 0 2 2 2 0 0 0 1 }{CSTYLE "Text" -1 223 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "_cstyle25" -1 234 "Times" 1 18 0 0 255 1 2 1 1 2 2 2 0 0 0 1 }{CSTYLE "_cstyle26" -1 235 "Helvetica" 1 14 128 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "_cstyle27" -1 236 "Helvetica" 1 12 128 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "_cstyle28" -1 237 "Helvetica" 1 12 128 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "_cstyle29" -1 238 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "_cstyle30" -1 239 "Courier" 1 12 255 0 0 1 2 1 2 2 1 2 0 0 0 1 }{CSTYLE "_cstyle31" -1 240 "Times" 1 14 0 0 0 1 2 1 2 2 2 2 0 0 0 1 }{CSTYLE "_cstyle32" -1 241 "Times" 1 14 0 0 0 1 2 1 2 2 2 2 0 0 0 1 }{CSTYLE "_cstyle34" -1 243 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "_cstyle35" -1 244 "Times" 0 1 0 0 0 0 0 0 0 2 2 2 0 0 0 1 }{CSTYLE "" -1 256 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 257 "" 0 1 255 0 255 1 0 0 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 258 "" 0 1 255 0 255 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 223 259 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 223 260 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 223 261 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 262 "" 0 1 255 0 255 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 263 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 } {CSTYLE "" 238 264 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 265 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 266 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 267 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 268 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 269 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 } {CSTYLE "" 238 270 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 271 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 272 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 273 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 274 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 275 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 276 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 277 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 278 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 279 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 280 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 } {CSTYLE "" 238 281 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 282 "" 0 1 255 0 255 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 283 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 284 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 285 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 286 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 } {CSTYLE "" 238 287 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 288 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 289 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 290 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 291 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 292 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 } {CSTYLE "" 238 293 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 294 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 295 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 296 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 297 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 298 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 } {CSTYLE "" 238 299 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 300 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 301 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 302 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 303 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 304 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 } {CSTYLE "" 238 305 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 306 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 238 307 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 18 308 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 18 309 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 18 310 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE " " 18 311 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 18 312 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 18 313 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 314 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 315 "" 0 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 316 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 317 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 318 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 319 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 321 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 322 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 323 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 324 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "_pstyle28" -1 229 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 255 1 2 1 1 2 2 2 1 0 0 1 }1 1 0 0 12 12 2 0 2 0 2 2 -1 1 }{PSTYLE "_pstyle29" -1 230 1 {CSTYLE "" -1 -1 "Helvetica" 1 14 128 0 0 1 2 2 2 2 2 2 1 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "_pstyle30" -1 231 1 {CSTYLE " " -1 -1 "Helvetica" 1 12 128 0 0 1 2 2 2 2 2 2 1 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "_pstyle31" -1 232 1 {CSTYLE "" -1 -1 "Helveti ca" 1 12 128 0 0 1 2 2 2 2 2 2 1 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 } {PSTYLE "_pstyle32" -1 233 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "_pstyle33" -1 234 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "_pstyle34" -1 235 1 {CSTYLE "" -1 -1 "Courier" 1 12 255 0 0 1 2 1 2 2 1 2 1 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "_pstyle35" -1 236 1 {CSTYLE "" -1 -1 "Times" 1 14 0 0 0 1 2 1 2 2 2 2 1 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "_pstyle36" -1 237 1 {CSTYLE "" -1 -1 "Times" 1 14 0 0 0 1 2 1 2 2 2 2 1 0 0 1 }1 1 0 0 8 2 2 0 2 0 2 2 -1 1 }{PSTYLE "_pstyle40" -1 241 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "_pstyle41" -1 242 1 {CSTYLE "" -1 -1 "Tim es" 0 1 0 0 0 0 0 0 0 2 2 2 0 0 0 1 }0 0 0 -1 -1 -1 2 0 2 0 2 2 -1 1 } {PSTYLE "_pstyle43" -1 244 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 2 2 2 0 0 0 1 }0 0 0 -1 -1 -1 1 0 1 0 2 2 -1 1 }} {SECT 0 {EXCHG {PARA 229 "" 0 "" {TEXT 234 33 "Differential Equations \+ with Maple" }}{PARA 230 "" 0 "" {TEXT 235 9 "Maple 9.5" }}{PARA 230 " " 0 "" {TEXT 235 19 "Mth 480 May 15 2007" }}{PARA 231 "" 0 "" {TEXT 236 16 "Bent E. Petersen" }}{PARA 232 "" 0 "" {TEXT 237 25 "Filename: \+ 480s2007_de.mws" }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}}{EXCHG {PARA 234 "" 0 "" {TEXT 223 150 "In this worksheet I give a few hints on usi ng Maple to study and to solve differential equations. Most of Maple' s capabilities will not be discussed." }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT 241 20 "Using this Worksheet" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 45 "Use the mouse to pos ition the cursor on the " }{TEXT 256 7 "restart" }{TEXT -1 89 " comm and line below. Note each command line is indicated by an initial wed ge >. Press " }{TEXT 257 5 "Enter" }{TEXT -1 80 " to execute the com mand and to proceed to the next command. Continue pressing " }{TEXT 258 5 "Enter" }{TEXT -1 245 " to execute commands in sequence and to \+ see what happens. Be sure to read the text between the commands. At so me point you will get bored being so well-behaved. Then you should sta rt trying to modify the commands, and in general, to experiment." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 234 "" 0 "" {TEXT 223 178 "I alw ays start a worksheet with restart to clean up anything left lying a round (since several worksheets can share data) and to make it easier \+ to recover from numerous errors. " }}{PARA 234 "" 0 "" {TEXT 223 0 "" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 8 "restart;" }}}{EXCHG {PARA 234 "" 0 "" {TEXT 223 0 "" }}{PARA 234 "" 0 "" {TEXT 223 13 "The command " }{TEXT 259 11 "with(plots)" }{TEXT 223 63 " below loads a package of useful plotting tools. The command " }{TEXT 260 14 "with( DEtools) " }{TEXT 223 176 " loads a package of tools useful for workin g with differential equations. We may not make much, perhaps not any, \+ use of it here, but you should know about it. Run the command " } {TEXT 261 9 "?DEtools " }{TEXT 223 19 " to learn about it." }}{PARA 234 "" 0 "" {TEXT 223 0 "" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 27 "with(plots): with(DEtools):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 223 66 "Note how several commands may be placed on the same command li ne. " }{TEXT -1 279 "If you run the commands above terminated by semic olons, rather than colons, you will see a list of the commands enabled by these packages. The text in blue is a system warning message (from Maple). You can frequently ignore such messages, but in some contexts they are important." }}}{EXCHG {PARA 233 "" 0 "" {TEXT 238 0 "" }} {PARA 236 "" 0 "" {TEXT 240 11 "Termination" }}{PARA 236 "" 0 "" {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 89 "In Maple every comman d is terminated by a semicolon or a colon and executed by pressing " }{TEXT 262 5 "Enter" }{TEXT 238 184 " while the cursor is on the line . The difference is simple - the colon suppresses any out put that th e command might make. Note that warning messages are not suppressed by the colon." }}{PARA 237 "" 0 "" {TEXT 241 9 "Equations" }}{PARA 233 " " 0 "" {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 281 "Maple deals w ell with expressions. Among the expressions that are of interest to us are equations. In Maple any expression, including an equation, may be assigned to a label. Thus we can take a simple equations such as A=B \+ and assign it to a label for ease in dealing with it. Thus" }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 10 "eqn1:=A=B;" }}}{EXCHG {PARA 233 "" 0 "" {TEXT 238 0 "" }} {PARA 233 "" 0 "" {TEXT 238 77 "Note how assignment is indicated by a \+ colon followed by an equals sign. Here " }{TEXT 263 4 "eqn1" }{TEXT 238 120 " is the label (or name) of the equation A=B. Sometimes we wis h to extract the left or right (hand) side of an equation. " }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 10 "lhs(eqn1);" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 10 "r hs(eqn1);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 25 "More information on the " }{TEXT 271 5 "lhs()" }{TEXT -1 50 " command may be obtained by running the command " }{TEXT 272 4 "?lhs" }{TEXT -1 39 " . Try it. Note help commands such as " } {TEXT 273 4 "?lhs" }{TEXT -1 33 " do not require any termination." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "?lhs" }}}{EXCHG {PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 0 "" 0 " " {TEXT -1 154 "Help for other commands may be obtained in the same ma nner. In addition you can also browse help for all commands by using t he help entry on the menu bar." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 233 "" 0 "" {TEXT 238 89 "There are devious, sometimes useful, \+ other ways to accomplish substitution. For example," }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 13 "sub s(eqn1,A);" }}}{EXCHG {PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 95 "Here we have taken the expression A and substituted A=B in it. The result is of course B. Note " }{TEXT 264 4 "eqn1" } {TEXT 238 146 " is not altered in any way - it simply provides the spe cification for what to substitute for what. A and B are also not al tered. Note also the " }{TEXT 265 6 "subs()" }{TEXT 238 41 " approach \+ has the advantage that, unlike " }{TEXT 266 5 "rhs()" }{TEXT 238 64 ", it correctly handles expressions containing several equations." }} {PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 31 "Ano ther approach is to use the " }{TEXT 267 8 "assign()" }{TEXT 238 144 " function. It assigns the right side of each equality in a list to the left side, that is the left side becomes a label for the right side. \+ Thus" }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}}{EXCHG {PARA 235 "> " 0 " " {MPLTEXT 1 239 13 "assign(eqn1);" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 5 "A; B;" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 8 "B:=6; A;" }}}{EXCHG {PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 233 " " 0 "" {TEXT 238 43 "In case we want to use A and B again let's " } {TEXT 268 10 "unassign()" }{TEXT 238 6 " them:" }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 19 "unassi gn('A','B'); " }}}{EXCHG {PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 169 "The single quotes here prevent Maple from evalu ating A and B. Otherwise we would be trying to unassign 6, which would produce an error, and perhaps some head-scratching." }}}{EXCHG {PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 237 "" 0 "" {TEXT 241 9 "Functions " }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 59 "A function in Maple may be defined by the \"arrow\" notation:" }} {PARA 233 "" 0 "" {TEXT 238 0 "" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 16 "f:=x->x^2+2*x-3;" }}}{EXCHG {PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 62 "A suitable expression may be converted to a function by using " }{TEXT 269 9 "unapply()" } {TEXT 238 6 ". Thus" }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 16 "expr:=x^2+2*x-3;" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 19 "g:=unapply(expr,x);" }}}{EXCHG {PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 117 "Fu nctions are evaluated in the usual familiar way, whereas expressions a re evaluated by using the substitute command " }{TEXT 270 6 "subs()" } {TEXT 238 6 ". Thus" }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 11 "f(t); f(6);" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 15 "subs(x=6,expr);" }}}{EXCHG {PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 151 "One thing to be careful about is the x in the arrow notation above is local to the function we are defining, that is, it is just a dummy variable. Thus " }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 11 "h:=x->expr;" }}}{EXCHG {PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 108 "does not define the same funct ion as f above, but instead defines the constant function whose value \+ is expr," }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 11 "h(t); h(6);" }}}{EXCHG {PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 95 "It is best not to be \+ too devious when defining functions. Errors like this can be hard to f ind!" }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 246 "Maple works well with expressions, but is not quite as compet ent with functions. If one plans to use Maple to simplify complicated \+ expressions, it is best to leave them as expressions, even if habit ma kes functions feel more natural to work with." }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 8 "is(f=g) ;" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 14 "is(f(x)=g(x));" }} }{EXCHG {PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 269 "Earlier versions of Maple respond FAIL to the first questio n here, later ones respond false. Note FAIL does not mean false. It m eans Maple does not know the answer. Neither answer agrees with normal ly sloppy habits of thought but I have a preference for FAIL here." }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 46 "T he differentiation operator for functions is " }{TEXT 274 3 "D()" } {TEXT 238 50 ". The differentiation operator for expressions is " } {TEXT 275 6 "diff()" }{TEXT 238 6 ". Thus" }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 5 "D(f);" }}} {EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 13 "diff(f(x),x);" }}} {EXCHG {PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 10 "Note that " }{TEXT 276 6 "diff()" }{TEXT 238 83 " is very easy to \+ use for partial derivatives and for higher order derivatives. Thus" }} {PARA 233 "" 0 "" {TEXT 238 0 "" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 35 "diff(arctan(y/x),x,y): simplify(%);" }}}{EXCHG {PARA 233 "" 0 "" {TEXT 238 504 "Note the use of Maple ditto operator \+ % above. Be very careful! This operator refers to the previously evalu ated expression (in time), not the previous expression on the workshee t. It makes a difference since one can move around and evaluate expres sions in numerous places on the worksheet, so previous in time need no t be the same as previous in location. The two are the same of course \+ if you restrict % to refer to an expression on the same line, as above . That is the safest way to use the % operator." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 21 "The string operat or " }{TEXT 277 1 "$" }{TEXT -1 42 " is useful for higher order der ivatives:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "x$7,y$3;" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 12 "Thus we have" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "diff(f(x,y),x$7,y$3);" }}}{EXCHG {PARA 233 " " 0 "" {TEXT 238 0 "" }}{PARA 237 "" 0 "" {TEXT 241 22 "Differential E quations" }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 11 "We use the " }{TEXT 278 8 "dsolve()" }{TEXT 238 240 " co mmand to solve differential equations. It returns an expression (which may be empty) which contains equations giving the solution. There are also numerous numeric versions which in a sense return a procedure fo r approximating a solution." }}{PARA 233 "" 0 "" {TEXT 238 0 "" }} {PARA 233 "" 0 "" {TEXT 238 18 "Here's an example:" }}{PARA 233 "" 0 " " {TEXT 238 0 "" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 31 "ode1 :=diff(y(x),x)=x*sec(y(x));" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 16 "init1:=y(0)=1/2;" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 28 "soln1:=dsolve([ode1,init1]);" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 25 "y:=unapply(rhs(soln1),x);" }}}{EXCHG {PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 57 "The disadvantage here is we have now assigned a value to " }{TEXT 279 1 "y" }{TEXT 238 29 ". We will not be able to use " }{TEXT 280 1 "y" }{TEXT 238 115 " again as a \"variable\" in a differential equation without first unassigning it. Just for fun try it. Go back up to " }{TEXT 281 4 "od e1" }{TEXT 238 10 " and hit " }{TEXT 282 5 "Enter" }{TEXT 238 7 ". Ou ch!" }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 128 "If you just want to plot the solution, or manipulate it in some o ther way, it is not necessary to convert it to a function. Thus" }} {PARA 233 "" 0 "" {TEXT 238 0 "" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 51 "plot(rhs(soln1),x=-1/2..1/2,color=red,thickness=4); " }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 12 "unassign(y);" }}} {EXCHG {PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 237 "" 0 "" {TEXT 241 33 "Systems of differential equations" }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 51 "Let's look at a simple system ( be sure you did the " }{TEXT 283 12 " unassign(y)" }{TEXT 238 10 " ab ove!):" }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 61 "ode2:=diff(y(t),t)=3*x(t)+2*y(t), diff(x(t),t)=2 *x(t)+3*y(t);" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 22 "init2: =x(0)=3,y(0)=-1;" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 40 "sol n2:=dsolve(\{ode2,init2\},\{x(t),y(t)\});" }}}{EXCHG {PARA 233 "" 0 " " {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 59 "The easiest way to \+ extract the individual pieces is to use " }{TEXT 284 8 "assign()" } {TEXT 238 7 ". Also " }{TEXT 285 8 "assign()" }{TEXT 238 55 " makes no assumptions about the order of the solutions." }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 14 "assign (soln2);" }}}{EXCHG {PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 18 "Note this assigns " }{TEXT 286 4 "x(t)" }{TEXT 238 5 " and " }{TEXT 287 4 "y(t)" }{TEXT 238 43 " as labels for the appropri ate expressions." }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 5 "x(t);" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 5 "y(t);" }}}{EXCHG {PARA 233 "" 0 "" {TEXT 238 0 "" }} {PARA 233 "" 0 "" {TEXT 238 32 "It is improtant to realise that " } {TEXT 288 1 "x" }{TEXT 238 5 " and " }{TEXT 289 1 "y" }{TEXT 238 114 " remain unassigned. If you want them to be functions corersponding to \+ the solutions you have to say so explicitly:" }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 39 "x:=una pply(x(t),t); y:=unapply(y(t),t);" }}}{EXCHG {PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 47 "Let's clean up before going to the next example" }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 14 "unassign(x,y);" }}}{EXCHG {PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 27 "We \+ do not need to unassign " }{TEXT 290 4 "x(t)" }{TEXT 238 5 " and " } {TEXT 291 4 "y(t)" }{TEXT 238 60 ". Those labels were clobbered when w e defined the functions " }{TEXT 292 1 "x" }{TEXT 238 5 " and " } {TEXT 293 1 "y" }{TEXT 238 39 ", since, after defining the functions, \+ " }{TEXT 294 4 "x(t)" }{TEXT 238 21 " became the function " }{TEXT 295 1 "x" }{TEXT 238 14 " evaluated at " }{TEXT 296 1 "t" }{TEXT 238 5 " and " }{TEXT 297 4 "y(t)" }{TEXT 238 21 " became the function " } {TEXT 298 1 "y" }{TEXT 238 14 " evaluated at " }{TEXT 299 1 "t" } {TEXT 238 2 ". " }}}{EXCHG {PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 36 "Consider now a second order equation" }} {PARA 233 "" 0 "" {TEXT 238 0 "" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 35 "ode3:=diff(y(x),x$2)+4*y(x)=sec(x);" }}}{EXCHG {PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 14 "Not e we used " }{TEXT 300 3 "x$2" }{TEXT 238 15 " rather than " } {TEXT 301 3 "x,x" }{TEXT 238 37 " to indicate the second derivative. \+ " }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 25 "soln3:=dsolve(ode3,y(x));" }}}{EXCHG {PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 191 "Note that Maple returns a solution containing arbitrary constants. We could of course have solved an initial value problem instead as above. In fact, we ca n even have symbolic initial values." }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 24 "init3:=y(0)=A,D(y) (0)=B;" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 34 "soln3b:=dsolv e(\{ode3,init3\},y(x));" }}}{EXCHG {PARA 237 "" 0 "" {TEXT -1 0 "" }} {PARA 237 "" 0 "" {TEXT 241 15 "Numeric Methods" }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 134 "Maple has a number o f numeric methods built in that can be used to solve differential equa tions that Maple can not solve symbolically." }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 45 "ode4:= diff(y(x),x)=x^2+x*y(x)+y(x)*tan(y(x));" }}}{EXCHG {PARA 235 "> " 0 " " {MPLTEXT 1 239 14 "init4:=y(0)=1;" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 33 "soln4:=dsolve(\{ode4,init4\},y(x));" }}}{EXCHG {PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 61 "The empty solution indicates Maple could not find a solution." }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 42 "soln4n:=dsolve(\{ode4,init4\},y(x),numeric);" }}}{EXCHG {PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 106 "This loo ks mysterious, but fortunately some Maple functions such as odeplot() \+ understand the returned data" }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}} {EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 56 "odeplot(soln4n,[x,y(x)], 0..0.12,thickness=3,color=blue);" }}}{EXCHG {PARA 237 "" 0 "" {TEXT 241 0 "" }}{PARA 237 "" 0 "" {TEXT 241 12 "Higher Order" }}{PARA 233 " " 0 "" {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 54 "Here is an exa mple of a simple equation of fifth order" }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 57 "ode5:=diff(y (t),t$5)-4*diff(y(t),t$3)+3*diff(y(t),t$2)=0;" }}}{EXCHG {PARA 235 "> \+ " 0 "" {MPLTEXT 1 239 70 "init5:=y(1)=2,D(y)(1)=0,(D@@2)(y)(1)=-3,(D@@ 3)(y)(1)=2,(D@@4)(y)(1)=1;" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 33 "soln5:=dsolve(\{ode5,init5\},y(t));" }}}{EXCHG {PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 139 "The solution is a bit difficult to interpret. Unless you really need the exact solution a floating point approximation might be preferable." }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 27 "e xpr5:=evalf(rhs(soln5),4);" }}}{EXCHG {PARA 233 "" 0 "" {TEXT 238 0 " " }}{PARA 233 "" 0 "" {TEXT 238 37 "Maple's numeric routines default t o \"" }{TEXT 302 6 "Digits" }{TEXT 238 107 "\" decimal digits of preci sion. The default is 10, but it can be changed by assigning a differen t number to " }{TEXT 305 6 "Digits" }{TEXT 238 15 ", for example, " } {TEXT 303 11 "Digits:=20;" }{TEXT 238 14 " The routine " }{TEXT 304 8 "evalf() " }{TEXT 238 68 " converts to floating point using the numb er of digits specified in " }{TEXT 306 6 "Digits" }{TEXT 238 78 ". Alt ernately one can specify the desired precision as the second variable \+ to " }{TEXT 307 7 "evalf()" }{TEXT 238 98 " - we used 4 above. This h as the advantage of not altering the precision for the whole worksheet ." }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}}{EXCHG {PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 237 "" 0 "" {TEXT 241 14 "An LCR circuit" }} {PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 241 "" 0 "" {TEXT 243 51 "Con sider a simple LCR circuit driven by a voltage " }{XPPEDIT 308 0 "4*c os(omega*t);" "6#*&\"\"%\"\"\"-%$cosG6#*&%&omegaGF%%\"tGF%F%" }{TEXT 243 9 " where " }{XPPEDIT 309 0 "0 < omega;" "6#2\"\"!%&omegaG" } {TEXT 243 108 " . Assume initially there is no charge on the capacitor and no current flowing in the circuit. Then at time " }{XPPEDIT 310 0 "t = 0;" "6#/%\"tG\"\"!" }{TEXT 243 56 " we switch on the source of \+ electromotive force. We have" }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}} {EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 64 "ode6:=L*diff(Q(t),t,t)+R *diff(Q(t),t)+(1/C)*Q(t)=4*cos(omega*t);" }}}{EXCHG {PARA 235 "> " 0 " " {MPLTEXT 1 239 24 "init6:=Q(0)=0,D(Q)(0)=0;" }}}{EXCHG {PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 241 "" 0 "" {TEXT 243 7 "where " } {XPPEDIT 311 0 "Q(t);" "6#-%\"QG6#%\"tG" }{TEXT 243 41 " is the charg e on the capacitor at time " }{XPPEDIT 312 0 "t;" "6#%\"tG" }{TEXT 243 1 "." }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 115 "Suppose the inductance is 1/4 henry, the resistance is \+ 100 ohms and the capacitance is 10^(-6) farads. Then we have" }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 40 "ode6b:=subs(L=1/4,R=100,C=10^(-6),ode6);" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 35 "soln6b:=dsolve(\{ode6b,init6\},Q(t)):" }} }{EXCHG {PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 233 "" 0 "" {TEXT 238 92 "The current flowing in the system is the rate of change of the charge on the capacitor. Thus" }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}} {EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 27 "expr6:=diff(rhs(soln6b), t):" }}}{EXCHG {PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 241 "" 0 "" {TEXT 243 29 "We can think of the current " }{XPPEDIT 18 0 "J;" "6#% \"JG" }{TEXT 243 20 " as a function of " }{XPPEDIT 18 0 "t;" "6#%\"t G" }{TEXT 243 7 " and " }{XPPEDIT 18 0 "omega;" "6#%&omegaG" }{TEXT 243 47 ". We have to unapply two variables in this case" }}{PARA 233 " " 0 "" {TEXT 238 0 "" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 28 "J:=unapply(expr6,[omega,t]):" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 103 "plot3d(J(omega,t),omega=0..6400,t=0..0.0059,axes=boxed,orie ntation=[35,55],thickness=2,numpoints=1000);" }}}{EXCHG {PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 241 "" 0 "" {TEXT 243 27 "Here the resonan ce peak at " }{XPPEDIT 313 0 "omega = 2000;" "6#/%&omegaG\"%+?" } {TEXT 243 70 " appears to be showing up, as does attenuation of highe r frequencies." }}{PARA 233 "" 0 "" {TEXT 238 0 "" }}{PARA 0 "" 0 "" {TEXT -1 22 "Let's have a look at " }{TEXT 314 5 "expr6" }{TEXT 315 15 " (the current)" }}}{EXCHG {PARA 235 "> " 0 "" {MPLTEXT 1 239 6 "e xpr6;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 164 "The terms here are periodoc in t or exponentially deca ying. By simply deleting the exponentials we will retain the long term behavior, that is, the steady state. " }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "expr7:=subs(exp(-200*t) =0,expr6);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 61 "The amplitude of th is periodic expression is easily computed:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 91 "ampl:=sqrt( coeff (expr7,cos(omega*t))^2 + coeff(expr7,sin(omega*t))^2 ); ampl:=simplify (%);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "plot(ampl,omega=0.. 5000,thickness=6);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 74 "Here we very clearly see the resonance peak at ab out 2000 cps. let's check" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "maximize(ampl^2,omega=0..infinity,l ocation);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 184 "Here the data returned signifies 1/625 is the maximum. T he following data is a list (with only one entry here) of local maxima and the value at each. Here's a simple example to clarify" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "max imize(sin(x),x=0..4*Pi,location);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "maximize(exp(x/20)*sin(x),x=0..4*Pi, location);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 138 "Note Pi (majuscule P) is the rati o of the circumference of a circle to its diameter, whereas pi (minus cule p) is simply the Greek letter " }{XPPEDIT 18 0 "pi;" "6#%#piG" } {TEXT -1 1 "." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 241 26 "Vector Fields in the Plane" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 791 "A vector field in the plane is simply an ordered pair of functions of the coordinates (assuming a fi xed coordinate system). Each ordered pair is viewed as the components \+ of a vector at the corresponding point. A solution, integral curve, t rajectory, moving point, etc., is simply a parametric curve whose tang ent at each point is the field vector at that point. The parameter is \+ often viewed as \"time\" indicated by a clock carried by the moving po int. In other words, it is legitimate to reparametrize the integral cu rves, though we expect the reparametrization to vary smoothly from tra jectory to trajectory. A pictorial representation of the vector field \+ obtained by plotting a few of the vectors is often called a direction \+ field though the term really refers to the entire vector field." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 252 "To find \+ the integral curves amounts simply to solving a system of two linked f irst order differential equations. The equations are autonomous if the field is constant (in time), else they are nonautonomous. Let's start with a simple autonomous example." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "eqn1:=diff(x(t),t)=f(x(t),y (t));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "eqn2:=diff(y(t),t) =g(x(t),y(t));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 116 "Note if we are just interested in the shape of the \+ trajectories we can eliminate the time (by using the chain rule):" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "eqn3:=diff(y(x),x)=g(x,y(x))/f(x,y(x));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 3 " or" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "eqn4:=diff(x(y),y)=f(x(y),y)/g(x(y),y);" }} }{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 34 "H ere's a linear autonomous system:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "eqn1a:=diff(x(t),t)=9*x(t)-1 5*y(t);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "eqn2a:=diff(y(t) ,t)=6*x(t)-9*y(t);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 42 "soln1 a:=dsolve(\{eqn1a,eqn2a\},\{x(t),y(t)\});" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 73 "If you don't like the notation for the arbitrary constant s, you can use " }{TEXT 316 7 "subst()" }{TEXT -1 70 " to change the m. Usually I don't bother, but here's one way to do it:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "subs(_ C1=a,_C2=b,soln1a);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 218 "It's somewhat difficult to visualize the traje ctories from this expression. Let's try eliminating the time in the or iginal equations. We could coerce Maple into doing it for us, but that seems overkill in this case. So" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "eqn3a:=diff(y(x),x)=(6*x-9*y(x))/(9*x-15*y(x));" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "soln3a:=dsolve(eqn3a);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 100 "T hat's hard to visualize too. Let's try a less explicit solution by req uesting an implicit solution." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "soln4a:=dsolve(eqn3a,implici t);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 87 "We want level curves of the left hand side of this expression s o we might as well toss " }{TEXT -1 77 "_C1. The logarithms suggest we take the exponential of twice this expression:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "subs(_C1=0, 2*lhs(soln4a)); soln5a:=simplify(exp(%));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 124 "We are still just intere sted in the level curves of this expression so we might as well take t he reciprocal and the replace " }{TEXT 321 4 "y(x)" }{TEXT -1 4 " by \+ " }{TEXT 322 1 "y" }{TEXT -1 1 ":" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "soln6a:=subs(y(x)=y,1/soln5a );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 86 "contourplot(soln6a,x= -4..4,y=-3..3,contours=[1/8,1/4,1/2],thickness=5,grid=[200,200]);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 241 19 "The DEtools package" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 4 "The " } {TEXT 319 7 "DEtools" }{TEXT -1 109 " package contains quite a few too ls for studying systems of differential equations. We will only discus s the " }{TEXT 318 8 "DEplot()" }{TEXT -1 29 " command. Let's re-exam ine " }{TEXT 323 5 "eqn1a" }{TEXT -1 7 " and " }{TEXT 324 5 "eqn2a " }{TEXT -1 13 " from above." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "eqn1a;" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 6 "eqn2a;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 69 "inita:=[ [x(0)=0,y(0)=1/4],[\nx(0)=0,y(0)=1/2],[x(0)=3/5,y(0)=7/ 10] ];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 135 "DEplot([eqn1a,eq n2a], [x(t),y(t)], t=-10..10, x=-2.5..2.5, y=\n-2..2, inita, arrows=SM ALL, stepsize=0.05, thickness=3, linecolor=blue\n);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 38 "We can suppress the arrows if desired:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 134 "DEplot([eqn1a,eqn2a], [x(t),y(t)], t=-10..10, x=-2.5..2.5, y=\n-2..2, inita, arrows=NONE, stepsize=0.05, thickness=3, linecolor=blue\n);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 6 "Note " }{TEXT 317 8 "DEplot()" } {TEXT -1 207 " works by doing numeric integration. Thus it can be use d to investigate systems that we can not integrate. It's a great tool. We can add more orbits simply by adding more data to the list of init ial points." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {PARA 242 "" 0 "" {TEXT 213 0 "" }{TEXT 244 0 "" }}{PARA 244 "" 0 "" {TEXT -1 0 "" }}}{MARK "139 3 7" 4 }{VIEWOPTS 1 1 0 3 2 1804 1 1 1 1 } {PAGENUMBERS 0 1 2 33 1 1 }