430 Chapter 7
> T[0,n](t):=eval(T[0,n](t));
T
0,n
(t) := −
π
√
2
−1 +(−1)
n
cos
√
n
2
t
n
3
(7.43)
Generalized series terms
> u[m,n](x,y,t):=eval(T[m,n](t)*X[m](x)*Y[n](y));
u
m, n
(x,y,t):= −
8
−1 +(−1)
n
−1 +(−1)
m
cos
m
2
+n
2
t
cos(mx) sin(ny)
π
2
m
2
n
3
(7.44)
> u[0,n](x,y,t):=eval(T[0,n](t)*X[0](x)*Y[n](y));
u
0,n
(x,y,t):= −
2
−1 +(−1)
n
cos
√
n
2
t
sin(ny)
n
3
(7.45)
Series solution
> u(x,y,t):=Sum(u[0,n](x,y,t),n=1..infinity)+Sum(Sum(u[m,n](x,y,t),m=1..infinity),
n=1..infinity);
u(x, y, t) :=
∞
n=1
⎛
⎝
−
2
−1 +(−1)
n
cos
√
n
2
t
sin(ny)
n
3
⎞
⎠
+
∞
n=1
⎛
⎝
∞
m=1
⎛
⎝
−
8
−1 +(−1)
n
−1 +(−1)
m
cos
m
2
+n
2
t
cos(mx) sin(ny)
π
2
m
2
n
3
⎞
⎠
⎞
⎠
(7.46)
First few terms of sum
> u(x,y,t):=sum(u[0,n](x,y,t),n=1..1)+sum(sum(u[m,n](x,y,t),m=1..1),n=1..1):
ANIMATION
> animate3d(u(x,y,t),x=0..a,y=0..b,t=0..3,axes=framed,thickness=1);
The preceding animation command illustrates the spatial-time-dependent solution for u(x, y, t).
The animation sequence in Figures 7.3 and 7.4 shows snapshots of the animation at times t = 0
and t = 2.
ANIMATION SEQUENCE
> u(x,y,0):=subs(t=0,u(x,y,t)):plot3d(u(x,y,0),x=0..a,y=0..b,axes=framed,thickness=1);