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.

3.3. SPECIAL FUNCTION MODELS 139<br />

the expression for the tension being automatically substituted.<br />

The equation of motion is a linear partial di®erential equation. Solving linear<br />

PDEs is the subject matter of Chapters 5 and 6. The PDE may be converted<br />

into an ODE by assuming a solution of the form Ã(y;t) =X(y)cos(!t), with<br />

! taken to be a positive angular frequency.<br />

> psi(y,t):=X(y)*cos(omega*t);<br />

Ã(y; t) :=X (y)cos(!t)<br />

With the assumed solution automatically substituted, the resulting output of<br />

eq is divided by cos(!t) and expanded to produce the ODE eq2 .<br />

> eq2:=expand(eq/cos(omega*t));<br />

μ μ μ <br />

2<br />

2<br />

d<br />

d d<br />

eq2 := ¡²g X (y) + ²g X (y) L ¡ ²g X (y) y = ¡² X (y) !<br />

dy dy2 dy2 2<br />

The second derivative terms are collected in eq2 ,<br />

> eq3:=collect(eq2,diff(X(y),y,y));<br />

μ μ 2 d d<br />

eq3 := (²gL¡ ²gy) X (y) ¡ ²g<br />

dy2 dy<br />

and a general analytic solution to eq3 obtained.<br />

<br />

X (y) = ¡² X (y) ! 2<br />

> sol:=dsolve(eq3,X(y));<br />

μ r <br />

μ r <br />

L ¡ y<br />

L ¡ y<br />

sol := X (y) = C1 BesselJ 0; 2 ! + C2 BesselY 0; 2 !<br />

g<br />

g<br />

The general solution is a linear combination of zeroth-order Bessel functions of<br />

the ¯rst and second kinds with arbitrary constants C1 and C2 . The Bessel<br />

Y0 function diverges to ¡1 at y = L so must be removed on physical grounds.<br />

> X:=remove(has,rhs(sol),BesselY);<br />

μ r <br />

L ¡ y<br />

X := C1 BesselJ 0; 2 !<br />

g<br />

To remove the arbitrary constant C1 ,theop command is used to select the<br />

second operand in X.<br />

> X:=op(2,X);<br />

μ r<br />

L ¡ y<br />

X := BesselJ 0; 2<br />

Taking the bungee cord length to be L = 30 meters, its density ² = 1<br />

2 kilogram/meter,<br />

and g =9:8 meter/second 2 ,theformofX is as follows:<br />

> L:=30: g:=9.8: epsilon:=1/2: X:=X;<br />

X := BesselJ(0; 2 p 3:061224489 ¡ 0:1020408163 y!)<br />

The transverse displacement X of the cord at y = 0 is zero, which is entered as<br />

a boundary condition, bc.<br />

g<br />

<br />

!<br />

> bc:=eval(X,y=0)=0;<br />

bc := BesselJ(0; 3:499271060 !) =0

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

Saved successfully!

Ooh no, something went wrong!