Chapter3-2e

Example 3.2-1

Figure 3.2-2 Initial shape of the string in Example 3.2-1

Figure 3.2-2 shows the initial displacement u(x,t) of a string stretched along the x-axis between x = 0 and x = 1. The string is free to vibrate in a fixed plane through the x-axis. Determine the subsequent motion of the string if it is released from rest, given that c = 1/p.

Solution

The equation that describes the string motion is the one-dimensional wave equation

= c2 0 < x < 1, t > 0 (3.2-1)

with boundary conditions

u(0,t) = 0 and u(1,t) = 0, for t ³ 0

and initial conditions

u(x,0) = f(x) and (x,0) = 0, for 0 x 1

The solution to the wave equation is

u(x,t) = sinx[cos(t) + sin(t)] (3.2-6)

u(x,t) = sin(npx)[cos(nt) + sin(nt)]

where

= = n = = 0

and

= = 2

= 2+ 2

The expressioncan be integrated by part

d(uv) = udv + vdu

= -

= -

Let u = x Þ du = dx

dv = sin(npx) dxÞ v = -cos(npx)

= -+

= + sin() + 2

= - + + 0.3 - 0.3

= - + - + -

= - + - + + - +

= - + + - +

= - + + +

= + = =

The solution is then

u(x,t) = sin(npx) cos(nt) = sin(npx) cos(nt)

Figure 3.2-3 The snapshot of the string at various time using 20 terms of the series solution.


______Table 3.2-1 Matlab program to plot u(x,t) at various time ______

% Plot the string motion in Example 3.2-1 at various t

%

x=0:.02:1; fx=x; nv=length(x);

%

% Label the time t for each displacement u, the character vector ax hold the data

%

ax='t=0.00t=0.50t=1.00t=1.50t=2.00t=2.50t=3.00t=3.50t=4.00';

%

% Set y-coordinate from -0.1 to 0.1

%

x1=[0 0];y1=[-0.1 0.1];x2=[0 1];y2=[0 0];

n=1:20;

for i=1:9;

t=0.5*(i-1);cosnt=cos(n*t);

%

% Extract the time from ax, label axi is used for x-axis label for the time

%

ib=1+(i-1)*6;ie=ib+5;

axi=ax(ib:ie);

for j=1:nv;

xi=x(j);sinx=sin(pi*n*xi);sincos=sinx.*cosnt;

bn=sin(n*pi/3)./n.^2;

fx(j)= bn*sincos';

end

fx=.9*fx/(pi*pi);

%

% Divide the plot window into 3 rows and 3 columns using subplot command

%

subplot(3,3,i),plot(x,fx,x1,y1,x2,y2)

xlabel(axi);ylabel('u')

end

44