This preview shows page 1. Sign up to view the full content.
Unformatted text preview: > with(plots, odeplot): > odeplot( sol3, [t, y(t)], 0..4 ); 7 6 y5 4 3 0 1 2 t 3 4 The DEtools package contains commands that can help you investigate, manipulate, plot, and solve diﬀerential equations. For details, refer to the ?DEtools help page. Interactive ODE Analyzer
The dsolve[interactive](odesys,options) command launches a graphical user interface for the investigation and solution of ODE and ODE systems. 270 • Chapter 7: Solving Calculus Problems If odesys is not given in the call to dsolve[interactive], then odesys can be entered by using the interface; otherwise, the input equations are examined and used as a starting point for the application (these equations can be changed from within the graphical user interface). For details about the command and interface, see ?dsolve,interactive and ?worksheet,interactive,dsolveinterface. 7.3 Partial Diﬀerential Equations Partial diﬀerential equations (PDEs) are in general very diﬃcult to solve. Maple provides a number of commands for solving, manipulating, and plotting PDEs. Some of these commands are in the standard library, but most of them reside in the PDEtools package. The pdsolve Command
The pdsolve command can solve many partial diﬀerential equations. This is the basic syntax of the pdsolve command. pdsolve( pde, var ) • pde is the partial diﬀerential equation • var is the variable with respect to which pdsolve solves The following is the onedimensional wave equation.
> wave := diff(u(x,t), t,t)  c^2 * diff(u(x,t), x,x); wave := ( ∂2 ∂2 u(x, t)) − c2 ( 2 u(x, t)) ∂t2 ∂x To solve for u(x,t), ﬁrst load the PDEtools package.
> with(PDEtools): > sol := pdsolve( wave, u(x,t) ); sol := u(x, t) = _F1(c t + x) + _F2(c t − x) Note the solution is in terms of two arbitrary functions, _F1 and _F2. To plot the solution you need a particular set of functions. 7.3 Partial Diﬀerential Equations > f1 := xi > exp(xi^2); • 271 f1 := ξ → e(−ξ 2) > f2 := xi > piecewise(1/2<xi and xi<1/2, 1, 0); f2 := ξ → piecewise( −1 1 < ξ and ξ < , 1, 0) 2 2 Substitute these functions into the solution.
> eval( sol, {_F1=f1, _F2=f2, c=1} ); u(x, t) = e(−(t+x) ) + 2 1 1 1 −t + x < and t − x < 2 2 0 otherwise Use the rhs command to select the solution.
> rhs(%); e(−(t+x) ) + 2 1 1 1 −t + x < and t − x < 2 2 0 otherwise The unapply command converts the expression to a function.
> f := unapply(%, x,t); f := (x, t) → e(−(t+x) ) + piecewise(−t + x < Plot the solution.
> plot3d( f, 8..8, 0..5, grid=[40,40] );
2 1 1 and t − x < , 1, 0) 2 2 272 • Chapter 7: Solving Calculus Problems Changing the Dependent Variable in a PDE
The following is the onedimensional heat equation.
> heat := diff(u(x,t),t)  k*diff(u(x,t), x,x) = 0; heat := ( ∂2 ∂ u(x, t)) − k ( 2 u(x, t)) = 0 ∂t ∂x Try to ﬁnd a solution of the form X (x)T (t) to this equation. Use the aptly named HINT option of pdsolve to suggest a cou...
View
Full
Document
This note was uploaded on 08/27/2012 for the course MATH 1100 taught by Professor Nil during the Spring '12 term at National University of Singapore.
 Spring '12
 NIL
 Math, Division

Click to edit the document details