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.

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

Pi<br />

2/3*Pi 1/3*Pi<br />

4/3*Pi<br />

0<br />

1/4<br />

1/2<br />

5/3*Pi<br />

3/4<br />

Figure 5.7: Constant r and μ lines in polar coordinates.<br />

The resulting picture is reproduced in Figure 5.7, circles being produced for<br />

r =0; 1 1 3 ; ; ; 1 and polar lines for μ =0;¼=3; 2 ¼=3; ¼;::::<br />

4 2 4<br />

Benny now enters Laplace's equation (LE ) in polar coordinates.<br />

> LE:=expand(Laplacian(phi(r,theta),'polar'[r,theta]))=0;<br />

LE :=<br />

@<br />

Á(r; μ)<br />

@r<br />

r<br />

μ 2 @<br />

+<br />

Á(r; μ)<br />

@r2 <br />

+<br />

1<br />

@2 Á(r; μ)<br />

@μ2 The pdsolve commandwiththeHINT=f(r)*g(theta), INTEGRATE and build<br />

options is used to ¯nd the general product solution of Laplace's equation.<br />

> sol:=pdsolve(LE,HINT=f(r)*g(theta),INTEGRATE,build);<br />

r 2<br />

=0<br />

sol := Á(r; μ) = C3 sin( p c1 μ) C1 r (p c1) + C3 sin( p c1 μ) C2<br />

r (p c1)<br />

+ C4 cos( p c1 μ) C1 r (p c1) + C4 cos( p c1 μ) C2<br />

r (p c1)<br />

Benny notes that the solution must reduce to a cos μ form on one boundary<br />

and a sin μ form on the other, so he accordingly sets the separation constant<br />

p c1 = 1 on the rhs of sol.<br />

> phi:=subs(sqrt(_c[1])=1,rhs(sol));<br />

C3 sin(μ) C2<br />

C4 cos(μ) C2<br />

Á := C3 sin(μ) C1 r + + C4 cos(μ) C1 r +<br />

r<br />

r<br />

The terms are then grouped by successively collecting cos μ, sinμ, andrterms.

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

Saved successfully!

Ooh no, something went wrong!