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.

140 CHAPTER 3. LINEAR ODE MODELS<br />

The boundary condition implies that there are certain allowed frequencies (eigenfrequencies)<br />

! of vibration, each frequency corresponding to a possible normal<br />

mode solution. A general transverse motion of the cord will involve a linear combination<br />

of normal modes, the combination depending on the initial conditions<br />

imposedonthecord.<br />

The eigenfrequencies will now be determined. First, the op command is<br />

used to extract the ¯rst element of the second argument on the lhs of bc.<br />

> c:=op([2,1],lhs(bc));<br />

c := 3:499271060<br />

Using the BesselJZeros command, the ¯rst 10 eigenfrequencies are numerically<br />

evaluated, and assigned.<br />

> freq:=seq(omega[n]=evalf(BesselJZeros(0,n)/c),n=1..10);<br />

freq := !1 =0:6872361462; !2 =1:577493717; !3 =2:473008739;<br />

!4 =3:369711645; !5 =4:266865142; !6 =5:164236682;<br />

!7 =6:061730076; !8 =6:959298411; !9 =7:856916100;<br />

!10 =8:754568007<br />

> assign(freq):<br />

A functional operator for creating the nth normal mode, with the time dependence<br />

included, is formed.<br />

> mode:=n->eval(X,omega=omega[n])*cos(omega[n]*t):<br />

As an explicit example, choosing n = N = 3 produces the normal mode X3<br />

corresponding to the third eigenfrequency.<br />

> N:=3: X[N]:=mode(N);<br />

X3 := BesselJ(0; 4:946017478 p 3:061224489 ¡ :1020408163 y)cos(2:473008739 t)<br />

The normal mode is now animated, the plot being rotated by ¡ ¼<br />

2 radians using<br />

the rotate command, so that the animated string is hanging vertically in equilibrium,<br />

rather than being pictured as horizontal. The scaling is constrained,<br />

so that the transverse displacement is small compared to the length of the cord.<br />

The axes are also removed so that the small vibrations are better viewed.<br />

> rotate(animate(plot,[X[N],y=0..L],t=0..10,color=red,<br />

frames=100,scaling=constrained,axes=none),-Pi/2);<br />

The animation can be observed on your computer by executing the above command<br />

line, clicking on the computer plot, and on the start arrow in the tool<br />

bar. You should also look at the other transverse vibrational modes as well, by<br />

changing the value of N from 3 to some other integer between 1 and 10. Or, if<br />

you want, you could generate even higher-integer normal modes.<br />

While we have been looking at Jennifer's computer algebra treatment of the<br />

transverse vibrations of the cord, Heather has completed her bungee jump, the<br />

largest of the vertical oscillations bringing her head to within a meter of the<br />

river far below the bridge. Looking rather pale, Heather attempts to persuade<br />

Jennifer to also do a bungee jump, but Jennifer sensibly declines.

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

Saved successfully!

Ooh no, something went wrong!