16.12.2012 Views

Computer Algebra Recipes

Computer Algebra Recipes

Computer Algebra Recipes

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

224 CHAPTER 5. LINEAR PDE MODELS. PART 1<br />

but all 1 have failed to pull the sword out of the rock. Having taken a course<br />

in thermodynamics as an engineering undergraduate, Russell speculates as to<br />

whether the sword could be pulled out by cooling the ends of the sword with<br />

large buckets of ice, thus causing heat to °ow out of the warmer interior of the<br />

sword's blade to the ends. If the sword were cooled su±ciently, its diameter<br />

might shrink slightly, and just possibly he could pull the sword out.<br />

But remembering the thermodynamics course causes Russell's dream to alter<br />

direction, and he then dreams of a related problem that appeared on that<br />

course's ¯nal exam many years ago. A thin 1-m-long rod (the sword's shaft)<br />

whose lateral surface is insulated to prevent heat °ow through that surface has<br />

its ends suddenly held at the freezing point of water, 0 ± C(contactwiththe<br />

buckets of ice). Taking one end of the rod to be at x = 0 and the other at x =<br />

L = 1, the initial temperature (T ) distribution was T (x; t =0)=100x (1 ¡ x),<br />

a parabolic pro¯le with a maximum temperature of 25 ± at the midpoint x = 1<br />

2 .<br />

In the exam, he was asked to determine the temperature distribution T (x; t) for<br />

any time t>0. Despite the passage of time, Russell remembers his approach to<br />

solving this problem very well. His method of attack was to solve the di®usion<br />

equation<br />

@T(x; t)<br />

@t<br />

by the method of separation of variables, i.e., assume that T (x; t)=S(x) F (t).<br />

Substituting this assumed form into (5.7) and dividing by T (x; t) yields<br />

1 dF (t) d d<br />

=<br />

F (t) dt S(x)<br />

2S(x) dx2 : (5.8)<br />

Since the lhs of (5.8) involves a function of t alone and the rhs involves a function<br />

of x alone, the only way that it can be generally true is for both sides to be<br />

equal to a common constant, called the separation constant. The separated<br />

ODE for S(x) is solved, subject to the boundary conditions, and the complete<br />

product solution constructed, subject to the initial condition.<br />

Russell's wild dream is interrupted by the roar of a big jet passing over his<br />

house on its way into Sky Harbor Airport. Waking up, and unable to get back<br />

to sleep, he decides to make a cup of instant decaf co®ee and implement an<br />

animated Maple solution of the heat di®usion problem on his computer. To<br />

carry out the animation, the plots library package is loaded. Noting that the<br />

di®usion coe±cient d could be absorbed into either the spatial or time variable,<br />

Russell sets d = 1 without loss of generality. He also speci¯es the rod's length,<br />

L = 1, and enters the heat equation (5.7).<br />

> restart: with(plots): d:=1: L:=1:<br />

> heateq:=diff(T(x,t),t)=d*diff(T(x,t),x,x);<br />

= d @2 T (x; t)<br />

@x 2 ; (5.7)<br />

heateq := @<br />

@2<br />

T (x; t) = T (x; t)<br />

@t @x2 A general solution to the heat equation is sought using the PDE solve (pdsolve)<br />

command, the HINT option explicitly telling Maple to separate variables.<br />

1 King Arthur has not shown up yet.

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

Saved successfully!

Ooh no, something went wrong!