Infinite and Semi-infinite Spatial Domains 577
The initial condition is
u(x, 0) = H(x)
where H(x) is the Heaviside function.
The convolution form of the solution, from Section 9.5 for no internal source, is
u(x, t) =
∞
−∞
f(s) e
−
(x−s)
2
4kt
2
√
πkt
ds
Assignment of system parameters
> restart:with(plots):k:=1/2:f(x):=Heaviside(x):f(s):=subs(x=s,f(x)):assume(t>0):
Convolution of the initial condition contribution
> u(x,t):=Int(f(s)*exp(−(x−s)ˆ2/(4*k*t))/(2*sqrt(Pi*k*t)),s=−infinity..infinity);
u(x, t∼) :=
∞
−∞
1
2
Heaviside(s) e
−
1
2
(x−s)
2
t∼
√
2
√
πt∼
ds (9.11)
Convolution solution
> u(x,t):=simplify(value(%));
u(x, t∼) :=
1
2
erf
1
2
x
√
2
√
t∼
+
1
2
(9.12)
where the erf (x) term denotes the error function.
ANIMATION
> animate(u(x,t),x=−5..5,t=1/100..5,thickness=3);
The preceding animation command shows the spatial-time-dependent solution of the
temperature u(x, t) in the medium. The animation sequence here and in Figure 9.2 shows
snapshots of the animation at times t = 0, 1, 2, 3, 4, 5.
ANIMATION SEQUENCE
> u(x,0):=subs(t=1/1000,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=−5..5,thickness=10);