12.07.2015 Views

Learning Guide Learning Guide

Learning Guide Learning Guide

Learning Guide Learning Guide

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

262 • Chapter 6: Examples from Calculus> wave := diff(u(x,t), t,t) - c^2 * diff(u(x,t), x,x);wave := ( ∂2∂t 2 u(x, t)) − c2 ( ∂2u(x, t))∂x2 You want to solve for u(x,t). First 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.> f1 := xi -> exp(-xi^2);f1 := ξ → e (−ξ2 )> f2 := xi -> piecewise(-1/2 rhs(%);({e (−(t+x)2) + 1 −t + x < 1 2 and t − x < 1 )20 otherwiseThe unapply command converts the expression to a function.> f := unapply(%, x,t);

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!