16.12.2012 Views

Computer Algebra Recipes

Computer Algebra Recipes

Computer Algebra Recipes

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6.2. SEMI-INFINITE AND INFINITE DOMAINS 265<br />

Then, the ordinary di®erential equation FCT is analytically solved for F (t),<br />

subject to the initial condition F (0) = F0 ,<br />

> eq:=dsolve(fFCT,F(0)=F0g,F(t));<br />

eq := F(t) = A p 2cos(sa) e (¡ds2 t)<br />

p<br />

¼<br />

and the inverse transform performed on the rhs of eq.<br />

> T:=fouriercos(rhs(eq),s,x);<br />

r<br />

¼<br />

A<br />

td<br />

T :=<br />

e(¡ a2 +x 2<br />

4 td ) ³<br />

ax<br />

´<br />

cosh<br />

2 td<br />

¼<br />

Looking at the analytic result for T , Vectoria is pleased that she has spent time<br />

learning how to use the Maple computer algebra system. Once she has set up<br />

a template for a certain type of problem, then any other problem of that type<br />

is generally trivial to tackle. In the real world, certain integrals and other steps<br />

may not be carried out analytically, but traditionally in the world of academia,<br />

problems are assigned by instructors for which analytic answers exist.<br />

To ¯nish o® the problem and complete the assignment, Vectoria evaluates<br />

T with the given parameter values (d =1,a =5,A =5),<br />

> T:=eval(T,fd=1,a=5,A=5g);<br />

r μ <br />

¼ 25+x2<br />

5 e(¡<br />

) 5 x<br />

4 t cosh<br />

t 2 t<br />

T :=<br />

¼<br />

and animates the solution over the suggested time interval t = 1 to 200. Clearly,<br />

the solution cannot be plotted at t = 0, because the initial pro¯le has been<br />

assumed to be a Dirac delta function. The number of points is controlled to<br />

product a smooth curve.<br />

> animate(plot,[T,x=0..20],t=1..200,numpoints=200,<br />

frames=50,thickness=2);<br />

As she watches the animation on the computer screen, Mike arrives to whisk<br />

her o® on their date.<br />

PROBLEMS:<br />

Problem 6-11: Fourier cosine transform<br />

Calculate the Fourier cosine transform of each f(x) belowandplottheanswers<br />

where possible:<br />

(a) f(x) =e ¡3 jxj ; (b) f(x) =cos(2x); (c) f(x) =sin(x) 2 ;<br />

(d) f(x) =x=(x2 +1).<br />

Problem 6-12: Di®erent initial condition<br />

Modify the text recipe to ¯nd the temperature distribution inside a semi-in¯nite<br />

rod (0 · x ·1) that is insulated at x = 0 and has the initial temperature<br />

distribution T (x >0; 0) = 25 x2 =(x2 +25)andd =1. AnimateT (x; t).

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

Saved successfully!

Ooh no, something went wrong!