LearningGuide

# qbinomial nk product1 qi in k1n product1 qi

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: rse of action. > pdsolve( heat, u(x,t), HINT=X(x)*T(t)); (u(x, t) = X(x) T(t)) &where d [{ dt T(t) = k _c 1 T(t), d2 dx2 X(x) = _c 1 X(x)}] The result here is correct, but diﬃcult to read. Alternatively, use product separation of variables with pdsolve (by specifying HINT=‘*‘) and then solve the resulting ODEs (by specifying the ’build’ option). > sol := pdsolve(heat, u(x,t), HINT=‘*‘, ’build’); √ _C3 e(k _c 1 t) _C2 sol := u(x, t) = e( _c 1 x) _C3 e(k _c 1 t) _C1 + √ e( _c 1 x) Evaluate the solution at speciﬁc values for the constants. > S := eval( rhs(sol), {_C3=1, _C1=1, _C2=1, k=1, _c[1]=1} ); 7.3 Partial Diﬀerential Equations • 273 S := ex et + et ex You can plot the solution. > plot3d( S, x=-5..5, t=0..5 ); Check the solution by evaluation with the original equation. > eval( heat, u(x,t)=rhs(sol) ); _C3 k _c 1 e(k _c 1 t) _C2 %1 (k _c 1 t) _C3 e _C2 _c 1 − k (_c 1 %1 _C3 e(k _c 1 t) _C1 + )=0 %1 √ %1 := e( _c 1 x) %1 _C3 k _c 1 e(k _c 1 t) _C1 + > simplify(%); 0=0 Plotting Partial Diﬀerential Equations The solutions to many PDEs can be plotted with the PDEplot command in the PDEtools package. > with(PDEtools): You can use the PDEplot command with the following syntax. PDEplot( pde, var, ini, s =range ) • pde is the PDE • var is the dependent variable 274 • Chapter 7: Solving Calculus Problems • ini is a parametric curve in three-dimensional space with parameter s • range is the range of s Consider this partial diﬀerential equation. > pde := diff(u(x,y), x) + cos(2*x) * diff(u(x,y), y) = -sin(y); pde := ( ∂ ∂ u(x, y )) + cos(2 x) ( u(x, y )) = −sin(y ) ∂x ∂y Use the curve given by z = 1 + y 2 as an initial condition, that is, x = 0, y = s, and z = 1 + s2 . > ini := [0, s, 1+s^2]; ini := [0, s, 1 + s2 ] PDEplot draws the initial-condition curve and the solution surface. > PDEplot( pde, u(x,y), ini, s=-2..2 ); 7 u(x,y) 1 –2 y 2 2 x –2 To draw the surface, Maple calculates these base characteristic curves. The initial-condition curve is easier to see here than in the previous plot. > PDEplot( pde, u(x,y), ini, s=-2..2, basechar=only ); 7.3 Partial Diﬀerential Equations • 275 5 u(x,y) 1 –2 y 2 2 x –2 With the basechar=true option, PDEplot draws both the characteristic curves and the surface, as well as the initial-condition curve which is always present. > PDEplot( pde, u(x,y), ini, s=-2..2, basechar=true ); 7 u(x,y) 1 –2 y 2 2 x –2 Many plot3d options are available. Refer to the ?plot3d,options help page. The initcolor option sets the color of the initial value curve. > PDEplot( pde, u(x,y), ini, s=-2..2, > basechar=true, initcolor=white, > style=patchcontour, contours=20, > orientation=[-43,45] ); 276 • Chapter 7: Solving Calculus Problems 7 u(x,y) 1 –2 x 2 –2 y 2 7.4 Conclusion This chapter has demonstrated how Maple can be used to aid in the investigation and solution of problems using calculus. You have seen how Maple can visually represent concepts, such as the derivative and the Riemann integral; help analyze the error term in...
View Full Document

Ask a homework question - tutors are online