510 Chapter 8
First few terms of sum
> u(x,t):=s(x,t)+sum(v[n](x,t),n=1..3):
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.5 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);
5
4
3
2
1
0
0 0.2 0.4 0.6 0.8 1
x
Figure 8.5
8.5 Nonhomogeneous Wave Equation
The generalized nonhomogeneous wave partial differential equation in one dimension over the
finite interval I ={x |0 <x<a}, with no damping in the system, has the form
∂
2
∂t
2
u(x, t) = c
2
∂
2
∂x
2
u(x, t)
+h(x, t)
Here, u(x, t) denotes the wave amplitude with dimensions of distance, c is the wave speed with
dimensions of distance per time, and h(x, t), with dimensions of force per mass, now accounts