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.

6.3. NUMERICAL SIMULATION OF PDES 275<br />

For example, in the forward di®erence approximation, the ¯rst spatial and<br />

time derivatives at P are written as<br />

μ <br />

@Ã<br />

=<br />

@x P<br />

(Ãi+1;j<br />

μ <br />

¡ Ãi;j) @Ã<br />

; =<br />

h<br />

@t P<br />

(Ãi;j+1 ¡ Ãi;j)<br />

; (6.16)<br />

k<br />

while the \standard" CDAs for the second derivatives at P are<br />

μ 2 @ Ã<br />

@x2 <br />

=<br />

P<br />

(Ãi+1;j ¡ 2 Ãi;j + Ãi¡1;j)<br />

h2 ; (6.17)<br />

μ 2 @ Ã<br />

@t2 <br />

=<br />

P<br />

(Ãi;j+1 ¡ 2 Ãi;j + Ãi;j¡1)<br />

k2 : (6.18)<br />

Although rectangular meshes are most commonly employed, diamond-shaped<br />

grids can also prove to be useful in certain numerical schemes used to model<br />

wave equations.<br />

6.3.1 Freeing Excalibur the Numerical Way<br />

\Are ¯ve nights warmer than one night, then?"<br />

Alice ventured to ask. \Five times as warm of course."<br />

\But they could be ¯ve times as cold, by the same rule|"<br />

\Just so!" cried the Red Queen.<br />

Lewis Carroll (Charles Lutwidge Dodgson), English writer (1832{1898)<br />

Recall that Russell, the aerospace engineer, was having a wild dream about<br />

freeing the sword Excalibur from its stony tomb by cooling its ends with buckets<br />

of ice water when his dream took a sudden detour and he recalled the<br />

following related problem from his undergraduate thermodynamics course.<br />

A thin 1-meter-long rod (the shaft of the sword), whose lateral surface is<br />

insulated to prevent heat °ow through that surface, has its ends suddenly held<br />

at the freezing point of water, 0 ± C, by placing them in contact with buckets of<br />

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

temperature distribution was T (x; t =0)=100x (1 ¡ x), a parabolic pro¯le<br />

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

2 .<br />

Russell was able to determine the analytic solution to this problem, using<br />

the separation of variables technique with the aid of Maple. Since it is now<br />

necessary in his work to numerically solve a system of nonlinear PDEs, and he<br />

hasn't done any numerical work for a while, he decides to tackle the Excalibur<br />

problem ¯rst, using an explicit ¯nite-di®erence scheme.<br />

In the linear di®usion equation (with di®usion coe±cient d =1), Russell<br />

replaces the time derivative with the forward-di®erence approximation and the<br />

second spatial derivative with the standard CDA, so that<br />

@T<br />

@t = @2T @x2 ) (Ti;j+1 ¡ Ti;j)<br />

=<br />

k<br />

(Ti+1;j ¡ 2 Ti;j + Ti¡1;j)<br />

h2 : (6.19)

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

Saved successfully!

Ooh no, something went wrong!