
Nonhomogeneous Partial Differential Equations 533
ANIMATION
> animate(u(x,t),x=0..a,t=0..5,thickness=3);
The preceding animation command displays the spatial-time-dependent solution of u(x, t) for
the given boundary conditions and initial conditions. The animation sequence here and in
Figure 8.7 shows snapshots of the animation at times t = 0, 1, 2, 3, 4, 5. Note how the solution
satisfies the given boundary and initial conditions.
ANIMATION SEQUENCE
> u(x,0):=subs(t=0,u(x,t)):u(x,1):=subs(t=1,u(x,t)):
> u(x,2):=subs(t=2,u(x,t)):u(x,3):=subs(t=3,u(x,t)):
> u(x,4):=subs(t=4,u(x,t)):u(x,5):=subs(t=5,u(x,t)):
> plot({u(x,0),u(x,1),u(x,2),u(x,3),u(x,4),u(x,5)},x=0..a,thickness=10);
0
0.5
1
1.5
2
0.2 0.4 0.6 1
x
0.8
Figure 8.7
EXAMPLE 8.7.3: (Longitudinal wave motion) We seek the wave amplitude u(x, t) for
longitudinal wave motion in a rigid bar over the interval I ={x |0 <x<1}. The left end of the
bar is held fixed, and the right end experiences an oscillatory compression (Young’s modulus
E = 1). There is no external applied force acting on the system. The bar has an initial
displacement distribution f(x) and initial speed distribution g(x) given as follows. The wave
speed is c = 1/5.
SOLUTION: The nonhomogeneous wave equation is
∂
2
∂t
2
u(x, t) = c
2
∂
2
∂x
2
u(x, t)
+h(x, t)
The boundary conditions are homogeneous type 1 at the left and nonhomogeneous type 2 at the
right:
u(0,t)= 0 and u
x
(1,t)= sin(t)