{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 "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 256 "" 0 1 0 0 0 0 0 1 0 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 0 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 260 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 261 "" 0 1 0 0 0 0 0 1 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 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Maple Output" -1 11 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 3 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Maple Plot" 0 13 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 "Title" -1 18 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 1 2 2 2 1 1 1 1 }3 1 0 0 12 12 1 0 1 0 2 2 19 1 }{PSTYLE "Author" -1 19 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 1 0 0 8 8 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 256 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 1 0 0 0 0 1 0 1 0 2 2 0 1 }} {SECT 0 {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 18 "" 0 "" {TEXT -1 23 "Solving a Linear System" }}{PARA 19 "" 0 "" {TEXT -1 8 "Math 30 8" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 72 "In t his example, we see how to solve a linear system of the form x'=Ax." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 7 "Suppose " }}{PARA 256 "" 0 "" {XPPEDIT 18 0 "A = matrix([[1, -2], [4, -5]]);" "6#/%\"AG-%'matrixG6#7$7$\"\"\",$\"\"#!\"\"7$\"\"%,$\"\"&F-" }{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 20 "and we want to solve" }}{PARA 256 "" 0 "" {TEXT -1 6 " " }{TEXT 256 1 "x" }{TEXT -1 5 "' = A" } {TEXT 257 2 "x," }}{PARA 0 "" 0 "" {TEXT -1 6 "where " }{TEXT 258 1 "x " }{TEXT -1 3 " = " }{XPPEDIT 18 0 "matrix([[x(t)], [y(t)]]);" "6#-%'m atrixG6#7$7#-%\"xG6#%\"tG7#-%\"yG6#F+" }}{PARA 0 "" 0 "" {TEXT -1 91 " The differential equation written in matrix form above is really two f irst order equations:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 256 "" 0 "" {TEXT -1 20 "x'(t) = x(t) - 2y(t)" }}{PARA 256 "" 0 "" {TEXT -1 21 "y'(t) = 4x(t) - 5y(t)" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT -1 72 "We define the problem in Maple by entering these e quations individually:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "e q1 := diff(x(t),t) = x(t)-2*y(t);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#> %$eq1G/-%%diffG6$-%\"xG6#%\"tGF,,&F)\"\"\"*&\"\"#F.-%\"yGF+F.!\"\"" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "eq2 := diff(y(t),t) = 4*x(t )-5*y(t);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%$eq2G/-%%diffG6$-%\"yG6 #%\"tGF,,&-%\"xGF+\"\"%*&\"\"&\"\"\"F)F3!\"\"" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 15 "We can use the " } {TEXT 259 7 "dsolve " }{TEXT -1 63 "function to solve the system. As \+ usual, the first argument to " }{TEXT 260 6 "dsolve" }{TEXT -1 241 " i s the problem to be solved, and the second argument holds the function s to be found. In this case, the problem is a system, so we put both \+ equations in brackets. Also, there are two functions to be found, so \+ we also put them in brackets." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "sol := dsolve([eq1,eq2],[x(t),y(t)]);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%$solG<$/-%\"yG6#%\"tG,&*&%$_C1G\"\"\"-%$expG6#,$F*!\" $F.F.*&%$_C2GF.-F06#,$F*!\"\"F.F./-%\"xGF),&F,#F.\"\"#F4F." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 345 "Note that Maple has returned the two fun ctions in a list, enclosed in curly brackets. To access the elements \+ of the list, we use the notation sol[i], where i is an integer. It is important to also notice that Maple did not put x(t) first; the order tends to be random. It might even be different the next time we ente r the exact same command." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "sol[2];" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#/-%\"xG6#%\"tG,&*&%$_C1G\" \"\"-%$expG6#,$F'!\"$F+#F+\"\"#*&%$_C2GF+-F-6#,$F'!\"\"F+F+" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "sol[1];" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#/-%\"yG6#%\"tG,&*&%$_C1G\"\"\"-%$expG6#,$F'!\"$F+F+*&%$ _C2GF+-F-6#,$F'!\"\"F+F+" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 40 "The vector form of the solution would be " }}{PARA 256 "" 0 "" {XPPEDIT 18 0 "matrix([[x(t)], [y(t)]]) = _C1*ma trix([[1/2], [1]])*exp(-3*t)+_C2*matrix([[1], [1]])*exp(-t);" "6#/-%'m atrixG6#7$7#-%\"xG6#%\"tG7#-%\"yG6#F,,&*(%$_C1G\"\"\"-F%6#7$7#*&F4F4\" \"#!\"\"7#F4F4-%$expG6#,$*&\"\"$F4F,F4F;F4F4*(%$_C2GF4-F%6#7$7#F47#F4F 4-F>6#,$F,F;F4F4" }{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 100 "Check this--you should understand that this is the same solution as the ind ividual functions in sol." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 128 "If we ha ve an initial value problem to solve, we must include the initial cond itions as part of the problem to be solved in the " }{TEXT 261 6 "dsol ve" }{TEXT -1 141 " function. Suppse we want to solve the above syste m, with the initial conditions x(0)=-1, y(0)=1. Here is how we can us e dsolve to do this:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 53 "sol 1 := dsolve([eq1,eq2,x(0)=-1,y(0)=1],[x(t),y(t)]);" }}{PARA 11 "" 1 " " {XPPMATH 20 "6#>%%sol1G<$/-%\"yG6#%\"tG,&-%$expG6#,$F*!\"\"!\"$*&\" \"%\"\"\"-F-6#,$F*F1F4F4/-%\"xGF),&F,F1*&\"\"#F4F5F4F4" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 358 "Here is one way to pull apart Maple's so lution and plot the results. Note that when I executed these commands , Maple put y(t) first and x(t) second in sol1. If they are in a diff erent order, you will have to change the indices in the following comm ands. Also note that I use the rhs function to get the right-hand sid e of the expression returned by Maple." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "solx := rhs(sol1[2]);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%%solxG,&-%$expG6#,$%\"tG!\"\"!\"$*&\"\"#\"\"\"-F'6#,$F*F,F/F/ " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "soly := rhs(sol1[1]);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%%solyG,&-%$expG6#,$%\"tG!\"\"!\"$* &\"\"%\"\"\"-F'6#,$F*F,F/F/" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "plot(\{solx,soly\},t=-0.25..3);" }}{PARA 13 "" 1 "" {GLPLOT2D 333 165 165 {PLOTDATA 2 "6&-%'CURVESG6$7Z7$$!3++++++++D!#=$\"3SvuQ;Q#fh%!# <7$$!3QLeRA\")*GK#F*$\"3Q6znHxPXUF-7$$!3wm;zWizX@F*$\"3a$pSq,F*$\"3+j0ef$*enNF-7$$!3]LLe*[#f\"z\"F*$\"3[ng=wF5eKF-7$$!3= ]P4'p,M[\"F*$\"3/u_U;mOiFF-7$$!3%o;/E!4@v6F*$\"3R$)fMDEs;BF-7$$!3_,DcE 7='G)!#>$\"3=.<.Ykmp=F-7$$!3rML3FMD?[FO$\"3%zs]2i%>u9F-7$$!3gKLL37NJ8F O$\"3:v@eZzyA6F-7$$\"3_pmT55bd@FO$\"3f+u#)HIGL\")F*7$$\"3(*)\\Pf3r)HcF O$\"3`ApGQH;EaF*7$$\"3TG$e9;\">-\"*FO$\"3_iS_&>z<0$F*7$$\"3-m\"Hd:wSb \"F*$!3sQ2-iM'G(eFO7$$\"3G*\\il#Gv?AF*$!333^XNC\"*zMF*7$$\"3+m\"HKzI- \"H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