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.

5.2. DIFFUSION AND LAPLACE'S EQUATION MODELS 239<br />

For an initial neutron density satisfying the boundary conditions, Hugo takes<br />

f to be of the following simple structure:<br />

> f:=(1-r^2/a^2)*sin(Pi*z/h);<br />

f :=<br />

μ<br />

1 ¡ r2<br />

a2 <br />

³<br />

¼z<br />

´<br />

sin<br />

h<br />

The coe±cients Cm;n are calculated, and then the Fourier term Nm;n.<br />

> C[m,n]:=int(int(r*f*g,z=0..h),r=0..a)<br />

/int(int(r*g^2,z=0..h),r=0..a):<br />

> N[m,n]:=C[m,n]*N2;<br />

For integer n>1, Nm;n should be equal to zero, since only an n =1term<br />

occurs in f. Hugo checks that this is the case.<br />

> simplify(N[m,n]) assuming n::integer,n>1;<br />

0<br />

To determine Nm;1 greater care must be exercised, and the limit taken as n ! 1.<br />

The result then is simpli¯ed with respect to the exponentials.<br />

> N[m,1]:=simplify(limit(N[m,n],n=1),exp);<br />

Nm; 1 := 8 sin<br />

³<br />

¼z<br />

´ μ<br />

BesselJ 0;<br />

h<br />

<br />

BesselJZeros(0; m) r<br />

a<br />

e (¡ (¡¯ a2 h 2 +d BesselJZeros(0;m) 2 h 2 +d¼ 2 a 2 ) t<br />

a2 h2 )<br />

Á<br />

BesselJ(1; BesselJZeros(0; m)) BesselJZeros(0; m) 3<br />

The total neutron density at time t then is P 1<br />

m=1 Nm;1. To plot the density,<br />

Hugo takes the nominal values a =1,h =1,andd = 1. In the time-dependent<br />

part of the density, the coe±cient of t is ¯ ¡ d (¸ 2 m =a2 + ¼ 2 =h 2 ). The largest<br />

possible positive value of this coe±cient occurs when m = 1, corresponding to<br />

the ¯rst zero of J0. Inthiscase¸1 ¼ 2:405. If<br />

¯

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

Saved successfully!

Ooh no, something went wrong!