{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 "Hyperlink" -1 17 "" 0 1 0 128 128 1 0 0 1 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 }{CSTYLE "2 D Input" 2 19 "" 0 1 255 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 256 " " 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 257 "" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Helvetica" 1 12 0 0 0 0 0 2 2 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 }1 0 0 0 6 6 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 -1 4 4 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 3" 4 5 1 {CSTYLE "" -1 -1 "" 1 12 0 0 0 0 1 0 0 0 0 0 0 0 0 }0 0 0 -1 0 0 0 0 0 0 0 0 -1 0 }{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 -1 3 3 0 0 0 0 0 0 15 2 }{PSTYLE "Title" 0 18 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 1 0 0 0 0 0 0 }3 0 0 -1 12 12 0 0 0 0 0 0 19 0 } {PSTYLE "Author" 0 19 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 0 0 -1 8 8 0 0 0 0 0 0 -1 0 }{PSTYLE "R3 Font 0" -1 256 1 {CSTYLE "" -1 -1 "Helvetica" 1 12 0 0 0 0 2 1 2 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "R3 Font 2" -1 257 1 {CSTYLE "" -1 -1 "Courier" 1 12 0 0 0 0 2 2 2 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 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 18 "" 0 "" {TEXT -1 48 "Discontinuous Coefficients and Forcing Functions " }}{PARA 18 "" 0 "" {TEXT 257 11 "discont.mws" }}{PARA 19 "" 0 "" {TEXT -1 36 "Douglas B. Meade\n(meade@math.sc.edu)" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 8 "Ove rview" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 312 "Differential equations w ith piecewise-defined coefficients (including the forcing function) ar ise in a number of natural circumstances. For example, the air resista nce encountered by a skydiver is (dramatically) different between the \+ free-fall and full deployment stages of the jump (see Example 3, pp. 1 12--113)" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 579 "We will use graphical solution methods to first see that the solu tion satisfies the fundamental principles for all differential equatio ns: solutions must follow the direction field. In particular, even tho ugh the direction field may not be continuous, the solution can still \+ be continuous (as would be expected in the skydiving example). The iss ue of finding an explicit formula for the solution is a little differe nt. The key is to break the problem into pieces where the solution can be determined, then to piece these solutions together with appropriat e transition conditions." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT -1 101 "The discussion follows the general steps found in Problems 31 and 32 from Section 2.3 Nagle and Saff." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 10 "Objectives" }}{EXCHG {PARA 15 "" 0 "" {TEXT -1 89 "understand how ODE s with discontinuous coefficients might arise in a physical applicatio n" }}{PARA 15 "" 0 "" {TEXT -1 101 "develop conceptual and mechanical \+ skills for the analysis of ODEs with piecewise-defined coefficients" } }{PARA 15 "" 0 "" {TEXT -1 79 "continue to develop Maple skills for th e manipulation of differential equations" }}{PARA 15 "" 0 "" {TEXT -1 59 "continue to built a geometric intuition about ODEs and IVPs" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 " " {TEXT -1 18 "New Maple Commands" }}{EXCHG {PARA 15 "" 0 "" {HYPERLNK 17 "piecewise" 2 "piecewise" "" }{TEXT -1 45 " creates a piecewise-defined function, " }{TEXT 256 4 "i.e." }{TEXT -1 73 ", a function defined by different rules for different parts of the domain " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 " " 0 "" {TEXT -1 62 "Problem 31 (Section 2.3, p. 53) --- Discontinuous \+ Coefficients" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 38 "There are times wh en the coefficient " }{XPPEDIT 18 0 "P(x)" "-%\"PG6#%\"xG" }{TEXT -1 190 " in a linear equation may not be continuous but may have a jump \+ discontinuity. Fortunately, we may still obtain a ``reasonable'' solut ion. For example, consider the initial value problem: " }{XPPEDIT 18 0 "y" "I\"yG6\"" }{TEXT -1 2 "'(" }{XPPEDIT 18 0 "x" "I\"xG6\"" } {TEXT -1 4 ") + " }{XPPEDIT 18 0 "P(x)*y = x" "/*&-%\"PG6#%\"xG\"\"\"% \"yGF(F'" }{TEXT -1 3 ", " }{XPPEDIT 18 0 "y(0)=1" "/-%\"yG6#\"\"!\" \"\"" }{TEXT -1 9 " where " }{XPPEDIT 18 0 "P(x) = 1" "/-%\"PG6#%\"x G\"\"\"" }{TEXT -1 9 " if 0<=" }{XPPEDIT 18 0 "x" "I\"xG6\"" }{TEXT -1 10 "<=2 and " }{XPPEDIT 18 0 "P(x)=3" "/-%\"PG6#%\"xG\"\"$" } {TEXT -1 6 " if " }{XPPEDIT 18 0 "x" "I\"xG6\"" }{TEXT -1 3 ">2." }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{SECT 1 {PARA 4 "" 0 " " {TEXT -1 8 "Solution" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "res tart;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "with( plots ):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "with( DEtools ):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 175 "Prior to \+ following the book's outline for the computation of an explicit soluti on, let's spend a little time considering exactly what the solution sh ould look like. For 0 <= " }{XPPEDIT 18 0 "x" "I\"xG6\"" }{TEXT -1 112 " <= 2, the problem is simply a standard IVP for a first-order li near equation with constant coefficients. For " }{XPPEDIT 18 0 "x" "I \"xG6\"" }{TEXT -1 169 ">2 a different ODE is involved, but it is sti ll a first-order linear equation with constant coefficients. The gener al solution to either problem is simple to determine." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 101 "The question is, exac tly which of these solutions should be selected to form the solution t o the IVP?" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 23 "The initial condition " }{XPPEDIT 18 0 " y(0)=1" "/-%\"yG6#\"\"!\"\"\"" }{TEXT -1 51 " identifies the specific solution curve for 0 <= " }{XPPEDIT 18 0 "x" "I\"xG6\"" }{TEXT -1 41 " <= 2. The solution curve followed for " }{XPPEDIT 18 0 "x" "I\" xG6\"" }{TEXT -1 233 ">2 is the one that meets the solution at the en d of the first stage. That is, the solution from the first stage is us ed to determine the initial condition for the second stage. (The preci se definition of this will be clearer later.)" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 123 "But first, let's develop some intuition by considering the direction field for this equation. \+ The ODE can be represented as" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "ODE := diff( y(x), x ) + P*y(x) = x;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 20 "The coefficient of " }{XPPEDIT 18 0 "y(x)" "-%\"yG6#%\"xG" }{TEXT -1 43 " can be defined, as a funct ion, using the " }{TEXT 19 9 "piecewise" }{TEXT -1 20 " command as fol lows:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "P := piecewise( x< =2, 1, 3 );" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 60 "We can check that \+ this definition is correct by evaluating " }{XPPEDIT 18 0 "P" "I\"PG6 \"" }{TEXT -1 20 " for a variety of " }{XPPEDIT 18 0 "x" "I\"xG6\"" }{TEXT -1 9 " values:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "s eq( eval(subs( x=X, P )), X=[ 0, 1, 2, 3, 4 ] );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 62 "Anoth er check is to explicitly view the differential equation:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "ODE;" }}}{SECT 1 {PARA 5 "" 0 "" {TEXT -1 36 "Alternate Approach (using functions)" }}{EXCHG {PARA 0 " " 0 "" {TEXT -1 85 "Note that if you wish to implement P as a function , it would be necessary to replace " }{TEXT 19 1 "P" }{TEXT -1 6 " wit h " }{TEXT 19 4 "P(x)" }{TEXT -1 4 " in " }{TEXT 19 3 "ODE" }{TEXT -1 38 " and to define the coefficient using " }{TEXT 19 34 "P := x -> pi ecewise( x<=2, 1, 3 );" }{TEXT -1 1 "." }}}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 45 "The initial condition can be represented as. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "IC := y(0)=1;" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 112 "The direction field for this problem is then crea ted exactly as all previous direction fields have been created:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "DEplot( ODE, y, x=0..5, \{ [ 0,1] \}, arrows=NONE," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 75 " ti tle=`Problem 31 (Section 2.3) -- Direction Field and Solution` );" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{SECT 1 {PARA 5 "" 0 "" {TEXT -1 16 "Bug in Release 4" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 97 "N ote that the arrows in the direction field are not displayed in the ab ove plot. This is because " }{TEXT 19 6 "DEplot" }{TEXT -1 104 " appea rs to be mishandling the piecewise defined coefficient. (See if you se e anything strange when the " }{TEXT 19 11 "arrows=NONE" }{TEXT -1 118 " option is removed.) This worked flawlessly in Release 3. This pr oblem has been reported to Maple's Technical Support." }}}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 48 "The solution obviously experiences a chan ge at " }{XPPEDIT 18 0 "x=2" "/%\"xG\"\"#" }{TEXT -1 75 ". This is a direct result of the discontinuity in the direction field at " } {XPPEDIT 18 0 "x=2" "/%\"xG\"\"#" }{TEXT -1 94 ". Note also how the s olution, which follows the direction field at all points, is continuou s." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 223 "The remainder of this problem is concerned with f inding an explicit solution to this problem. This will be done in a se ries of steps that require the application of our prior knowledge abou t solving first-order linear ODEs:" }}}{SECT 1 {PARA 5 "" 0 "" {TEXT -1 45 "(a) Find the general solution for 0 <= x <= 2" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 20 "For these values of " }{XPPEDIT 18 0 "x" "I\"xG 6\"" }{TEXT -1 3 ", " }{XPPEDIT 18 0 "P(x)=1" "/-%\"PG6#%\"xG\"\"\"" }{TEXT -1 33 " and the integrating factor is " }{XPPEDIT 18 0 "mu(x) =exp(x)" "/-%#muG6#%\"xG-%$expG6#F&" }{TEXT -1 27 ". The general solu tion is:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "ODE1 := diff( y (x), x ) + y(x) = x;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "GSO LN1 := dsolve( ODE1, y(x) );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 5 "" 0 "" {TEXT -1 94 "(b) Choose the constan t in the solution of part (a) so that the initial condition is satisfi ed" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 26 "The initial condition is " }{XPPEDIT 18 0 "y(0)=1" "/-%\"yG6#\"\"!\"\"\"" }{TEXT -1 29 ". The ap propriate value of " }{TEXT 19 3 "_C1" }{TEXT -1 25 " can be found a s follows" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "CEQN1 := subs( x=0, IC, GSOLN1 );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "CSOL N1 := solve( CEQN1, \{ _C1 \} );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "SOLN1 := subs( CSOLN1, GSOLN1 );" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 4 "or, " }{TEXT 19 6 "dsolve" }{TEXT -1 53 " could be \+ used to find the solution in one clean step" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "dsolve( \{ ODE1, IC \}, y(x) );" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 75 "Well, a second step is required to put the solu tion in a more familiar form" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "expand( \" );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} }{SECT 1 {PARA 5 "" 0 "" {TEXT -1 38 "(c) Find the general solution fo r x>2" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 47 "The differential equatio n for these values of " }{XPPEDIT 18 0 "x" "I\"xG6\"" }{TEXT -1 4 " \+ is" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "ODE2 := diff( y(x), x ) + 3*y(x) = x;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 27 "The integrati ng factor is " }{XPPEDIT 18 0 "mu(x) = exp(3*x)" "/-%#muG6#%\"xG-%$ex pG6#*&\"\"$\"\"\"F&F," }{TEXT -1 29 " and the general solution is" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "GSOLN2 := dsolve( ODE2, y(x ) );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 5 "" 0 "" {TEXT -1 141 "(d) choose the constant in the general solutio n from part (c) so that the solution from part (b) and the solution fr om part (c) agree at x=2" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 22 "In ot her words, find " }{TEXT 19 3 "_C1" }{TEXT -1 9 " so that" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 66 "Limit( rhs(SOLN1), x=2, left ) = Limit( rhs(GSOLN2), x=2, right );" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 72 "Note that this condition forces the continuity of the sol ution for all " }{XPPEDIT 18 0 "x" "I\"xG6\"" }{TEXT -1 4 ">=0." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 95 "Another way of thinking about this is to say that the ini tial condition for the second stage (" }{XPPEDIT 18 0 "x" "I\"xG6\"" }{TEXT -1 87 ">2) is obtained from the value of the solution at the e nd of the first stage. That is," }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "IC2 := subs( x=2, SOLN1 );" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 62 "This initial condition can then be used to find the value of \+ " }{TEXT 19 3 "_C1" }{TEXT -1 114 " that yields the solution which ag rees with the solution during the first stage. The compatibility condi tion at " }{XPPEDIT 18 0 "x=2" "/%\"xG\"\"#" }{TEXT -1 5 " is:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "CEQN2 := subs( x=2, IC2, GSO LN2 );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 104 "Solving for the unknown constant and inserting this value into the general solution proceeds as follows:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "CSOLN2 := solve( CEQN2, \{ _C1 \} ) ;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "SOLN2 := simplify( sub s( CSOLN2, GSOLN2 ) );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 100 "A more direct solution to this problem can be obtained by directly solving the appropriate IVP for \+ " }{XPPEDIT 18 0 "x" "I\"xG6\"" }{TEXT -1 3 ">2:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "dsolve( \{ ODE2, IC2 \}, y(x) );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "simplify( \" );" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 113 "Thus, the continuous solution to this problem is the solution formed by piecing together the solutions for 0 <= " } {XPPEDIT 18 0 "x" "I\"xG6\"" }{TEXT -1 16 " <= 2 and for " } {XPPEDIT 18 0 "x" "I\"xG6\"" }{TEXT -1 54 ">2. This is most convenien tly accomplished using the " }{TEXT 19 9 "piecewise" }{TEXT -1 9 " com mand:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 50 "SOLN := piecewise( x<=2, rhs(SOLN1), rhs(SOLN2) );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 5 "" 0 "" {TEXT -1 52 "(e) Sketch \+ the graph of the solution from x=0 to x=5" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 175 "There are a number of ways in which the graph can be con structed. One of the most efficient, and straightforward, is to use th e previously defined piecewise-defined solution, " }{TEXT 19 4 "SOLN" }{TEXT -1 52 ". Then the requested plot is obtained with a single " } {TEXT 19 4 "plot" }{TEXT -1 8 " command" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 76 "plot( SOLN, x=0..5, title=`Problem 31 (Section 2.3) - - Explicit Solution` );" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 100 "Note \+ that this solution agrees with the graphical solution obtained at the \+ beginning of the problem." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 20 "Update for Release 4" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 125 "One of the new features in Release 4 is the ability to s olve ODEs and IVPs with piecewise-defined coefficients directly with \+ " }{TEXT 19 6 "dsolve" }{TEXT -1 38 ". We illustrate for this example; see " }{HYPERLNK 17 "?dsolve,piecewise" 2 "dsolve,piecewise" "" } {TEXT -1 18 " for more details." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "IVP := \{ ODE, IC \};" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "SOLNp := dsolve( IVP, y(x) );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{SECT 1 {PARA 5 "" 0 "" {TEXT -1 16 "Bug In Relea se 4" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 127 "It appears as though ther e are problems with this solution; the first piece is redundant. The c ause of the false transition at " }{XPPEDIT 18 0 "t=4/3" "/%\"tG*&\"\" %\"\"\"\"\"$!\"\"" }{TEXT -1 98 " has not been fully investigated but \+ there are other problems with this solution. The output from " }{TEXT 19 6 "dsolve" }{TEXT -1 110 " is not always the same: sometimes the so lution is correct, sometimes the solution is incorrect and sometimes \+ " }{TEXT 19 6 "dsolve" }{TEXT -1 158 " returns no value. The following plot allows a simple comparison of the solutions. This problem was re ported to Maple's Technical Support on 12 November 1996." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "plot( rhs(SOLNp), x=0..5 );" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 63 "Problem \+ 32 (Section 2.3, p. 54) --- Discontinuous Forcing Terms" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 39 "There are times when the forcing term " }{XPPEDIT 18 0 "Q(x)" "-%\"QG6#%\"xG" }{TEXT -1 265 " in a linear equ ation may not be continuous but may have a jump discontinuity. Fortuna tely, we may still obtain a reasonable solution imitating the procedur e discussed in Problem 31. Use this procedure to find the continuous s olution to the initial value problem " }{XPPEDIT 18 0 "y" "I\"yG6\"" }{TEXT -1 2 "'(" }{XPPEDIT 18 0 "x" "I\"xG6\"" }{TEXT -1 4 ") + " } {XPPEDIT 18 0 "2*y = Q(x)" "/*&\"\"#\"\"\"%\"yGF%-%\"QG6#%\"xG" } {TEXT -1 3 ", " }{XPPEDIT 18 0 "y(0)=0" "/-%\"yG6#\"\"!F&" }{TEXT -1 9 " where " }{XPPEDIT 18 0 "Q(x) = 2" "/-%\"QG6#%\"xG\"\"#" }{TEXT -1 11 " if 0 <= " }{XPPEDIT 18 0 "x" "I\"xG6\"" }{TEXT -1 12 " <= 3 \+ and " }{XPPEDIT 18 0 "Q(x) = -2" "/-%\"QG6#%\"xG,$\"\"#!\"\"" } {TEXT -1 6 " if " }{XPPEDIT 18 0 "x" "I\"xG6\"" }{TEXT -1 5 " > 3." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 39 "Sketch \+ the graph of the solution from " }{XPPEDIT 18 0 "x=0" "/%\"xG\"\"!" } {TEXT -1 6 " to " }{XPPEDIT 18 0 "x=7" "/%\"xG\"\"(" }{TEXT -1 1 ". " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 8 "Solution" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " restart;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "with( plots ):" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "with( DEtools ):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 43 "O ne Maple implementation of this problem is" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 39 "ODE := diff( y(x), x ) + 2*y(x) = Q(x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "IC := y(0) = 0;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 57 "where the piecewise-defined right-hand side is de fined as" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "Q := x -> piece wise( x<=3, 2, -2 );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }} }{EXCHG {PARA 0 "" 0 "" {TEXT -1 8 "That is," }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "ODE;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 111 "Not e that the RHS has been defined as a function (compare this with the a pproach used in the previous example)." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 83 "The direction field and graphical solution to this IVP are produced by one call to \+ " }{TEXT 19 6 "DEplot" }{TEXT -1 1 ":" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "DEplot( ODE, y, x=0..7, \{ [0,0] \}, arrows=NONE," }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 80 " title=`Problem 32 (Section 2.3 ) -- Direction Field & Graphical Solution` );" }}}{SECT 1 {PARA 5 "" 0 "" {TEXT -1 16 "Bug in Release 4" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 76 "The direction field has a similar problem as was noted in the firs t example." }}}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 69 "The low resolution of this graph could be improved by specifying the " }{TEXT 19 9 "stepsize=" }{TEXT -1 25 " o ptional argument. (The " }{TEXT 19 8 "dirgrid=" }{TEXT -1 178 " option is often useful when trying to get a decent picture of the direction \+ field.) Regardless, it seems as though the solution to the first solut ion wants to be asymptotic to " }{XPPEDIT 18 0 "y=1" "/%\"yG\"\"\"" } {TEXT -1 30 " initially, but the jump in " }{XPPEDIT 18 0 "Q" "I\"QG 6\"" }{TEXT -1 32 " pushes the solutions towards " }{XPPEDIT 18 0 "y =-1" "/%\"yG,$\"\"\"!\"\"" }{TEXT -1 23 " for large values of " } {XPPEDIT 18 0 "t" "I\"tG6\"" }{TEXT -1 59 ". The explicit solution sh ould confirm these observations." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 147 "The explicit solution is found by following the outline introduced in Problem 31. \+ Both the ``long'' and the ``short'' methods will be demonstrated." }}} {SECT 1 {PARA 5 "" 0 "" {TEXT -1 29 "Solution by ``long approach''" }} {EXCHG {PARA 0 "" 0 "" {TEXT -1 69 "The ``long approach'' begins by fi nding the general solution on 0 <= " }{XPPEDIT 18 0 "x" "I\"xG6\"" } {TEXT -1 6 " <= 3:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "ODE1 \+ := diff( y(x), x ) + 2*y(x) = 2;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 39 "Then, find th e value of the constant, " }{TEXT 19 3 "_C1" }{TEXT -1 39 ", that sa tisfies the initial condition" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "GSOLN1 := dsolve( ODE1, y(x) );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "CEQN1 := subs( x=0, IC, GSOLN1 );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "CSOLN1 := solve( CEQN1, \{ _C1 \} );" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "SOLN1 := subs( CSOLN1, GSOLN 1 );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 55 "The general solution to the differential equation for " }{XPPEDIT 18 0 "x" "I\"xG6\"" }{TEXT -1 24 ">3 is found as fo llows:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "ODE2 := diff( y(x ), x ) + 2*y(x) = -2;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "GS OLN2 := dsolve( ODE2, y(x) );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 58 "To ensure continuity of \+ the final solution, the constant " }{TEXT 19 3 "_C1" }{TEXT -1 38 " \+ must be chosen so the solution for " }{XPPEDIT 18 0 "x" "I\"xG6\"" } {TEXT -1 38 ">3 agrees with the solution for 0 <= " }{XPPEDIT 18 0 "x " "I\"xG6\"" }{TEXT -1 29 " <= 3 at the boundary point " }{XPPEDIT 18 0 "x=3" "/%\"xG\"\"$" }{TEXT -1 8 ". Thus," }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 26 "IC2 := subs( x=3, SOLN1 );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "CEQN2 := subs( x=3, IC2, GSOLN2 );" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "CSOLN2 := solve( CEQN2, \{ _ C1 \} );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "SOLN2 := simpli fy( subs( CSOLN2, GSOLN2 ) );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 5 "" 0 "" {TEXT -1 30 "Solution by ``short ap proach''" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 207 "The ``short approach' ' is characterized by working with the solution to two initial value p roblems, rather than the general solutions to an ODE. The first step i s to solve the initial value problem for 0 <= " }{XPPEDIT 18 0 "x" "I \"xG6\"" }{TEXT -1 6 " <= 3:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "SOL N1a := dsolve( \{ ODE1, IC \}, y(x) );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 62 "The initial c ondition for the second stage is found as before:" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 28 "IC2a := subs( x=3, SOLN1a );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "SOLN2a := dsolve( \{ ODE2, IC2 \}, \+ y(x) );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "SOLN2a := simpli fy( SOLN2a );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 61 "In either case, the complete solut ion can be expressed using " }{TEXT 19 9 "piecewise" }{TEXT -1 1 ":" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 50 "SOLN := piecewise( x<=3, r hs(SOLN1), rhs(SOLN2) );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 76 "plot( SOLN, x=0..7, title=`Problem 32 (Section 2.3) -- Explicit Solut ion` );" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 140 "Note that this plot h as better resolution, and better exhibits the previously identified as ymptotic behaviors, than the plot generated with " }{TEXT 19 6 "DEplot " }{TEXT -1 66 " (the DEplot could be improved by specifying a suffici ently small " }{TEXT 19 8 "stepsize" }{TEXT -1 2 ")." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 5 "" 0 "" {TEXT -1 20 "Update for Release 4" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 25 "The direc t solution from " }{TEXT 19 6 "dsolve" }{TEXT -1 39 " appears to be co rrect for this problem" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "S OLNp := dsolve( \{ ODE, IC \}, y(x) );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "plot( rhs(SOLNp), x=0..7 );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 9 "Copyright" }}{EXCHG {PARA 0 " " 0 "" {TEXT -1 73 "discont.mws -- a Maple worksheet illustrating Ma ple solution techniques" }}{PARA 0 "" 0 "" {TEXT -1 88 " \+ for IVPs with discontinuous coefficients and forcing t erms" }}{PARA 0 "" 0 "" {TEXT -1 74 " (fo r use with section 2.3 of Nagle and Saff)" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 45 "Prepared by: Douglas B. Meade (7 \+ March 1996)" }}{PARA 0 "" 0 "" {TEXT -1 88 " a s part of the Maple Supplement for Nagle/Saff (Addison-Wesley)" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 70 "Updated t o Maple V, Release 4, by Douglas B. Meade (27 December, 1996)" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 78 "For more \+ information, please contact the author at one of following addresses: " }}{PARA 0 "" 0 "" {TEXT -1 90 " Department of Mat hematics, Univ. of South Carolina, Columbia, SC 29208" }}{PARA 0 "" 0 "" {TEXT -1 35 " (803) 777-6183" }}{PARA 0 "" 0 " " {TEXT -1 38 " meade@math.sc.edu" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 35 "(copyright, Douglas B. Meade, 1996)" }}}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}} {MARK "0 0 0" 0 }{VIEWOPTS 1 1 0 3 4 1802 }