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.1. WAVE EQUATION MODELS 259<br />

Then S3 is converted to trig form and the result expanded.<br />

> S4:=expand(convert(S3,trig));<br />

S4 := C1 BesselJ(m; ® r) C5 C3 cos(qz)cos(mμ)<br />

¡ C1 BesselJ(m; ® r) C5 C3 sin(qz)sin(mμ)<br />

+ ¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢<br />

Approximating the metallic walls of the cylinder as being rigid, the normal<br />

component of the °uid velocity must vanish at the walls. Since the velocity<br />

is equal to minus the gradient of the potential, this implies that the normal<br />

derivative of the potential must vanish at the walls. In the z direction, one<br />

must have dZ=dz =0atz = 0, so only terms involving cos(qz)areselected.<br />

> S5:=select(has,S4,cos(q*z));<br />

S5 := C1 BesselJ(m; ® r) C5 C3 cos(qz)cos(mμ)+¢¢¢<br />

To satisfy the derivative boundary condition on the top face of the cylinder at<br />

z = h, one must have sin(qh)=0,orq = n¼=h,withn =0; 1; 2;::::<br />

For the angular part to remain single-valued as μ increases by 2 ¼, onemust<br />

have cos(m (μ +2¼)) = cos(μ), which is satis¯ed if m =0; 1; 2; :::: Negative<br />

integer values of m need not be considered because the minus sign can be<br />

absorbed in the arbitrary constants. Similar remarks apply to sin(mμ), which<br />

also appears in S5 . So the allowed Bessel functions are J0; J1; J2; etc.<br />

To satisfy the derivative condition on the cylindrical wall, one must have<br />

(d=dr)Jm(®m;s r)jr=a =0,whereslabels the zeros of the derivative of the mthorder<br />

Bessel function. For later convenience, Vectoria sets ®m;s = ¼pm;s=a,<br />

the values of pm;s still to be determined. The allowed values of q and ® are<br />

subsituted into S5 and the result factored.<br />

> S6:=factor(subs(fq=n*Pi/h,alpha=Pi*p[m,s]/ag,S5));<br />

S6 := (¡cos(mμ) C3 I ¡ cos(mμ) C4 I +sin(mμ) C3 ¡ sin(mμ) C4)<br />

³<br />

n¼z<br />

´ ³<br />

cos BesselJ m;<br />

h<br />

¼pm; s r<br />

´<br />

C1 ( C5 + C6 ) I<br />

a<br />

Replacing the awkward coe±cient combinations with An;m;s and Bn;m;s gives<br />

normal modes of the following form. For each m value, except m =0,thereare<br />

actually two modes corresponding to cos(mμ) and sin(mμ).<br />

> NM:=(A[n,m,s]*cos(m*theta)+B[n,m,s]*sin(m*theta))<br />

*select(has,S6,fcos(n*Pi*z/h),BesselJg);<br />

³<br />

n¼z<br />

´ ³<br />

NM := (An; m; s cos(mμ)+Bn; m; s sin(mμ)) cos BesselJ m;<br />

h<br />

¼pm; s r<br />

´<br />

a<br />

Noting that the boundary condition (d=dr)(Jm(¼pm;s r=a)jr=a = 0 may be<br />

rewritten as (d=dp)(Jm(¼p)jp = pm;s = 0, Vectoria creates a functional operator<br />

f to apply the derivative boundary condition at the cylinder wall.<br />

> f:=m->diff(BesselJ(m,Pi*p),p)=0:<br />

Then using f, she employs a do loop to numerically determine pm;s for m =0<br />

and 1 and s =0tos =4.

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

Saved successfully!

Ooh no, something went wrong!