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.

5.1. CHECKING SOLUTIONS 213<br />

a piecewise function, is slightly harder to verify. One approach is to plot the<br />

velocity pro¯le predicted by the series solution at t =0andcompareitwiththe<br />

analytic piecewise form. Adding, say, the ¯rst ¯ve terms in the series solution,<br />

> psi:=add(psi[n],n=1..5);<br />

8 va(<br />

à :=<br />

p ³<br />

¼x<br />

´ μ <br />

¼ct<br />

2¡1) sin sin<br />

a a<br />

¼3 μ μ <br />

2 ¼x 2 ¼ct<br />

2 vasin sin<br />

a<br />

a<br />

+<br />

c<br />

¼3 c<br />

+ 8<br />

va(<br />

27<br />

p μ μ <br />

3 ¼x 3 ¼ct<br />

2+1)sin sin<br />

a<br />

a<br />

¼3 c<br />

+ 8<br />

va(¡<br />

125<br />

p μ μ <br />

5 ¼x 5 ¼ct<br />

2 ¡ 1) sin sin<br />

a<br />

a<br />

¼3 c<br />

and di®erentiating with respect to time, yields the velocity in the transverse<br />

direction (output suppressed here).<br />

> vel:=diff(psi,t);<br />

To plot the transverse velocity at t = 0, some representative values must be<br />

substituted for the parameters. Vectoria chooses v =5,a =2,andc =1.<br />

> t:=0: v:=5: a:=2: c:=1:<br />

To compare the series representation at t = 0 with the given piecewise initial<br />

velocity distribution, the latter is entered,<br />

> V:=piecewise(x

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

Saved successfully!

Ooh no, something went wrong!